| 12345678910111213141516171819202122232425 |
- /** 作品/喜欢列表分页解包(复用 feed 模块,兼容 images 字符串 / 嵌套 data) */
- export { extractFeedPage as extractContentPage } from '@/features/feed/clip-normalize'
- /** 合辑列表分页解包 */
- export function extractSeriesPage(payload) {
- const body = payload && typeof payload === 'object' ? payload : {}
- const rows = Array.isArray(body)
- ? body
- : Array.isArray(body.data)
- ? body.data
- : []
- return {
- rows,
- currentPage: Number(body.current_page || 1),
- lastPage: Number(body.last_page || body.current_page || 1)
- }
- }
- export function stripRichText(html) {
- if (!html) return ''
- return String(html)
- .replace(/<[^>]+>/g, '')
- .replace(/ /g, ' ')
- .trim()
- }
|