forked from angelo/web-retail-h5
feat(app): set token if url has token query
This commit is contained in:
parent
e89e3ac5e8
commit
6280f3b418
17
App.vue
17
App.vue
|
@ -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 {
|
||||
this.$store.dispatch('GetInfo')
|
||||
this.$store.dispatch('getCarLength')
|
||||
}
|
||||
if (whiteList.indexOf(options.path) !== -1) return
|
||||
this.$store.dispatch('GetInfo')
|
||||
this.$store.dispatch('getCarLength')
|
||||
uni.hideTabBar({})
|
||||
},
|
||||
onShow: function () {
|
||||
|
|
Loading…
Reference in New Issue