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