3
0
Fork 0

feat(app): set token if url has token query

This commit is contained in:
woody 2025-04-19 11:52:43 +08:00
parent e89e3ac5e8
commit 6280f3b418
1 changed files with 9 additions and 8 deletions

13
App.vue
View File

@ -6,11 +6,14 @@
* @Date: 2022-11-21 15:11:22
-->
<script>
import { setToken } from '@/config/auth.js'
export default {
onLaunch: function () {
let url = window.location.href.split('/#/')[1].split('?')[0]
onLaunch: function (options) {
//
if (options.query?.token) {
setToken(options.query?.token)
}
const whiteList = [
// 'pages/shareRegist/index',
// 'pages/shareRegist/success',
@ -21,11 +24,9 @@ export default {
// 'pages/shareArea/hiOrder',
// 'pages/pay/hiPay'
]
if (whiteList.indexOf(url) !== -1) {
} else {
if (whiteList.indexOf(options.path) !== -1) return
this.$store.dispatch('GetInfo')
this.$store.dispatch('getCarLength')
}
uni.hideTabBar({})
},
onShow: function () {