| | |
| | | duration: 0, |
| | | params: { |
| | | nationality: data.countryName, // 国籍 |
| | | idName: data.idname || 'id/passpost', // 证件名称 |
| | | idName: data.idname || 'id/passport', // 证件类型 |
| | | idNumber: data.idnumber, // 证件号码 |
| | | name: data.name, // 姓名 |
| | | name: data.name, // 姓 last name |
| | | firstName: data.firstName, // 名 |
| | | birth: data.birth, // 生日 |
| | | idFrontImg: data.frontFile.length && data.frontFile[0].resURL || '', |
| | | idBackImg: data.reverseFile.length && data.reverseFile[0].resURL || '', |
| | | // handheldPhoto: data.fileList.length && data.fileList[0].resURL || '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | data: params, |
| | | }) |
| | | }; |
| | | |
| | | // 首页新闻 Tab:美国头条,返回 articles 数组(兼容多种后端返回结构) |
| | | export const _getUsHeadNews = () => { |
| | | return request({ |
| | | url: `${API_PREFIX}/news!getUsHeadNews.action`, |
| | | method: METHODS.GET, |
| | | returnType: 'origin', // 拿原始 res.data,避免拦截器只返回 data 导致取不到 articles |
| | | }).then((res) => { |
| | | if (!res) return []; |
| | | // 标准包装:{ code: 0, data: { articles } } 或 data 为数组 |
| | | const raw = res.data != null ? res.data : res; |
| | | if (Array.isArray(raw)) return raw; |
| | | if (raw && Array.isArray(raw.articles)) return raw.articles; |
| | | if (raw && Array.isArray(raw.list)) return raw.list; |
| | | if (Array.isArray(res.articles)) return res.articles; |
| | | if (Array.isArray(res.list)) return res.list; |
| | | return []; |
| | | }).catch(() => []); |
| | | }; |
| | | //首页弹出新闻 |
| | | export const _getPopupNews = (params) => { |
| | | return request({ |