|
@@ -7,9 +7,11 @@ import {md} from '@/utils/common'
|
|
|
// import { Loading } from 'element-ui';
|
|
|
// import { ElLoadingComponent } from 'element-ui/types/loading';
|
|
|
// import vm from "@/main";
|
|
|
-import { Toast } from 'vant';
|
|
|
+import { Toast, Dialog } from 'vant';
|
|
|
// import vue from 'vue';
|
|
|
import store from '@/store';
|
|
|
+import {backLbsHome, getsTheCurrentTopic} from "@/utils";
|
|
|
+import kipTheme from '@/kui/theme/theme'
|
|
|
// import { v4 as uuidv4 } from 'uuid';
|
|
|
// import { wxToLoginCallback } from '@/utils/index.js'
|
|
|
let loadingInstance = null;
|
|
@@ -102,6 +104,20 @@ function XUser(config) {
|
|
|
// isLogin: store.state?.member?.vipcode ? true : false
|
|
|
isLogin: store.state?.isLogin === 'haveLoggedIn'
|
|
|
};
|
|
|
+ if(!params.isLogin) {
|
|
|
+ delete params.vipCode
|
|
|
+ delete params.userId
|
|
|
+ delete params.phoneNumber
|
|
|
+ }
|
|
|
+ if(params.isLogin && (!params.vipCode || !params.userId) && config.url.indexOf('/parking-lots/') < -1) {
|
|
|
+ throw {
|
|
|
+ response: {
|
|
|
+ data: {
|
|
|
+ code:'BAD_USER_INFO'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
// params = {"userId": "8aaa809d835ba76d018378bc57180006","sourceType": "WECHAT","phoneNumber": "18521563898","projectId": "paroject1","buildingId": "QHKC-P1","brandId":"8a84853b7c91ac5b017c962dab55030e","cid": "oIUfO5XAVleJ88z13i1_08DCKIhQ","vipCode":"KERRY100200040","lbsId":"8aaa81cb7c836c6b017c83e46b110001"}
|
|
|
if (/orders-and-prepay|calculate-discount|unlicensed-car-check-in|unlicensed-car-checkout|paper-coupon/g.test(config.url)) {
|
|
|
params.buildingId = window.localStorage.getItem('buildingId');
|
|
@@ -203,6 +219,10 @@ export const createAxiosByinterceptors = (config) => {
|
|
|
if (codeList.indexOf(code) > -1) {
|
|
|
uni.showToast({ title: langMessage || message, duration: 3000, icon: 'fail' });
|
|
|
}
|
|
|
+ // 如果必填参数校验失败的话
|
|
|
+ if (['BAD_USER_INFO'].indexOf(code) > -1) {
|
|
|
+ backLbsHome()
|
|
|
+ }
|
|
|
if ( status === 500 ) {
|
|
|
uni.showToast({ title: error.response.data.error, duration: 3000, icon: 'fail' });
|
|
|
}
|