Merge branch 'develop' of http://gitlab.xiaopeng.local:18080/robotaxi1/xp-robotaxi-miniprogram into develop
| | |
| | | console.log('dispatchMobileBind,sessionCode: ', this.sessionCode); |
| | | this.props.dispatchMobileBind(params, false) |
| | | .then(bindPhoneRes => { |
| | | console.log('dispatchMobileBind res: ', bindPhoneRes); |
| | | if (ENV === 'weapp' || ENV === 'tt') { |
| | | // "loginFlag":"0", 0:旧用户 1:新用户注册 |
| | | this.loginFlagStr = bindPhoneRes.loginFlag; |
| | |
| | | } |
| | | } |
| | | |
| | | console.log('setStorage bindPhoneRes'); |
| | | return Promise.all([ |
| | | Taro.setStorage({ key: _UID, data: bindPhoneRes.uid }), |
| | | Taro.setStorage({ key: 'otp', data: bindPhoneRes.otp }), |
| | | ]) |
| | | .then(() => this.requestXpUserInfo()); |
| | | .then(() => { |
| | | console.log('requestXpUserInfo'); |
| | | return this.requestXpUserInfo(); |
| | | }); |
| | | }) |
| | | .then(xpUserRes => { |
| | | console.log('xpUserRes: ', xpUserRes); |
| | | Taro.hideLoading(); |
| | | if (xpUserRes) { |
| | | // 微信小程序新用户注册时特定入口出现购车计划 |
| | |
| | | requestXpUserInfo = () => { |
| | | return this.props.dispatchGetXpUserInfo({}, false) |
| | | .then(xpUserRes => { |
| | | console.log('dispatchGetXpUserInfo res: ', xpUserRes); |
| | | console.log('dispatchGetXpUserInfo res type: ', typeof xpUserRes); |
| | | console.log(xpUserRes); |
| | | if (!xpUserRes) { |
| | | console.warn('⚠️ xpUserRes 为空,请检查 API 响应或网络请求'); |
| | | throw new Error('获取用户信息失败:API 返回为空'); |
| | | } |
| | | if (xpUserRes) { |
| | | /** |
| | | * 为了配合数据中台统计数据,每次登录时使用gdp('setUserId', id)来上报用户id |
| | |
| | | } |
| | | return xpUserRes; |
| | | }) |
| | | .catch(() => { |
| | | .catch((err) => { |
| | | console.error('dispatchGetXpUserInfo: ', err); |
| | | // 待公共处理 |
| | | Taro.setStorage({ key: 'otp', data: '' }) |
| | | .then(() => { |
| | |
| | | |
| | | export default function WebViewPage() { |
| | | const router = useRouter(); |
| | | const url = decodeURIComponent(router.params.url || ''); |
| | | const url = decodeURIComponent(router.params.pageUrl || ''); |
| | | |
| | | return ( |
| | | <WebView src={url} /> |
| | |
| | | export const extractPointsFromPolygons = (polygons: any[]) => { |
| | | const points: any[] = []; |
| | | if (!polygons || !Array.isArray(polygons)) return points; |
| | | |
| | | |
| | | polygons.forEach(polygon => { |
| | | if (polygon.points && Array.isArray(polygon.points)) { |
| | | points.push(...polygon.points); |
| | |
| | | } else if (jumpType === 3) { |
| | | if (jumpUrl) { |
| | | Taro.navigateTo({ |
| | | url: `/pages/webpage/index?url=${encodeURIComponent(jumpUrl)}` |
| | | url: `/pages/webpage/index?pageUrl=${encodeURIComponent(jumpUrl)}` |
| | | }); |
| | | } |
| | | } |
| | |
| | | export const getCityInfoWithId = async (cityCode: string, cityName: string) => { |
| | | try { |
| | | const res: any = await getOpenCity(); |
| | | |
| | | |
| | | let cityId = 0; |
| | | if (Array.isArray(res.cities)) { |
| | | const target = res.cities.find(item => item.adcode === cityCode); |
| | |
| | | let { code } = res.data; |
| | | code = code ? code : res.data.status; |
| | | |
| | | // DEBUG: 当 data 为空时打印原始响应,排查接口返回格式问题 |
| | | if (data === undefined || data === null) { |
| | | console.warn(`⚠️ [request] API 返回 data 为空, url: ${url}`); |
| | | console.warn('⚠️ [request] 原始响应 res.data:', res.data); |
| | | } |
| | | |
| | | if (skipException) { // 跳过异常处理 |
| | | const authExpired = CODE_AUTH_EXPIRED_ARRAY.indexOf(code) !== -1; |
| | | if (authExpired && autoLogin && needLogin) { // 登录相关的异常除外 |
| | |
| | | 'XP-Nonce': header['XP-Nonce'], |
| | | // 'XP-Signature': PUBLIC_HEADER['XP-Signature'], |
| | | 'XP-Deviceid': header['XP-Deviceid'], |
| | | 'XP-Sort-Payload': header['XP-Sort-Payload'], |
| | | 'XP-Sort-Payload': header['XP-Sort-Payload'], |
| | | ...extraData, |
| | | } |
| | | const sign_1st = makeSign(method, midData, payload, _XP_SECRET); |