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