This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-03-18 16:05:58 +08:00
parent 069dba3a17
commit cb0aee5cd5
1 changed files with 46 additions and 44 deletions

90
App.vue
View File

@ -1,6 +1,6 @@
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
@ -20,9 +20,9 @@
getUserInfo
} from '@/api/user.js';
import {
parseToken
} from "@/api/appLet.js";
import {
parseToken
} from "@/api/appLet.js";
import {
HTTP_REQUEST_URL
} from './config/app';
@ -32,7 +32,9 @@
history
} from '@/api/public.js'
import Routine from './libs/routine.js';
import { Toast } from "./libs/uniApi";
import {
Toast
} from "./libs/uniApi";
export default {
data() {
@ -97,26 +99,26 @@
key: 'launchFlag'
})
//
// parseToken({
// token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjZXNoaS1taWRkbGUubGloYWluay5jbiIsImF1ZCI6ImNlc2hpLW1pZGRsZS5saWhhaW5rLmNuIiwiaWF0IjoxNzAwNjIwMjUxLCJuYmYiOjE3MDA2MjAyNTEsImV4cCI6MTcwMTIyNTA1MSwiZGF0YSI6eyJ1aWQiOjUsInBob25lIjoiMTc2ODUxNTE2NDMiLCJhdmF0YXIiOiIvcmVzb3VyY2UvaW1hZ2UvYWRtaW5hcGkvZGVmYXVsdC9kZWZhdWx0X2F2YXRhci5wbmciLCJuaWNrbmFtZSI6Ilx1NzUyOFx1NjIzNzE3Njg1MTUxNjQzIn19.sTWAHCScRY9FExwJw1MReHTnRBcK7tYu1AMSia_Sm4M'
// }).then((res)=>{
// this.$store.commit("LOGIN", {
// 'token': res.data.token,
// 'time': 604800
// });
// this.$isResolve()
// }).catch((err)=>{
// if(err==''){
// this.$store.commit("LOGIN", {
// 'token': option.referrerInfo?.extraData?.uniMP,
// 'time': 604800
// });
// }else {
// Toast(err);
// }
// this.$isResolve()
// })
//
// parseToken({
// token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjZXNoaS1taWRkbGUubGloYWluay5jbiIsImF1ZCI6ImNlc2hpLW1pZGRsZS5saWhhaW5rLmNuIiwiaWF0IjoxNzAwNjIwMjUxLCJuYmYiOjE3MDA2MjAyNTEsImV4cCI6MTcwMTIyNTA1MSwiZGF0YSI6eyJ1aWQiOjUsInBob25lIjoiMTc2ODUxNTE2NDMiLCJhdmF0YXIiOiIvcmVzb3VyY2UvaW1hZ2UvYWRtaW5hcGkvZGVmYXVsdC9kZWZhdWx0X2F2YXRhci5wbmciLCJuaWNrbmFtZSI6Ilx1NzUyOFx1NjIzNzE3Njg1MTUxNjQzIn19.sTWAHCScRY9FExwJw1MReHTnRBcK7tYu1AMSia_Sm4M'
// }).then((res)=>{
// this.$store.commit("LOGIN", {
// 'token': res.data.token,
// 'time': 604800
// });
// this.$isResolve()
// }).catch((err)=>{
// if(err==''){
// this.$store.commit("LOGIN", {
// 'token': option.referrerInfo?.extraData?.uniMP,
// 'time': 604800
// });
// }else {
// Toast(err);
// }
// this.$isResolve()
// })
if (option?.referrerInfo?.extraData?.uniMP) {
uni.setStorageSync('uniMP', option.referrerInfo?.extraData?.uniMP);
@ -124,25 +126,25 @@
// 'token': option.referrerInfo?.extraData?.token,
// 'time': 604800
// });
parseToken({
token: option.referrerInfo?.extraData?.token
}).then((res)=>{
this.$store.commit("LOGIN", {
'token': res.data.token,
'time': 604800
});
this.$isResolve()
}).catch((err)=>{
this.$store.commit("LOGIN", {
'token': option.referrerInfo?.extraData?.token,
'time': 604800
});
console.log('TOKEN解析错误:', err);
this.$isResolve()
})
}else {
this.$isResolve()
}
parseToken({
token: option.referrerInfo?.extraData?.token
}).then((res) => {
this.$store.commit("LOGIN", {
'token': res.data.token,
'time': 604800
});
this.$isResolve()
}).catch((err) => {
this.$store.commit("LOGIN", {
'token': option.referrerInfo?.extraData?.token,
'time': 604800
});
console.log('TOKEN解析错误:', err);
this.$isResolve()
})
} else {
this.$isResolve()
}
// #ifdef APP-PLUS
// #endif