| xqd
@@ -6,7 +6,8 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- path: '/pages/index/index'
|
|
|
+ path: '/pages/index/index',
|
|
|
+ query: {}
|
|
|
}
|
|
|
},
|
|
|
computed: {},
|
| xqd
@@ -19,13 +20,33 @@ export default {
|
|
|
await this.$store.dispatch('user/token', token)
|
|
|
await this.$store.dispatch('user/info', user_info)
|
|
|
uni.reLaunch({
|
|
|
- url: this.path.replace('//', '/')
|
|
|
+ url: this.path,
|
|
|
+ success() {
|
|
|
+ console.log('-->success')
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ })
|
|
|
+ console.log('-->error', err)
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
+ console.log('-->data', options)
|
|
|
this.path = options.path ? options.path : this.path
|
|
|
+ this.path = this.path.replace('//', '/')
|
|
|
+ this.path = this.path.indexOf('/') !== 0 ? '/' + this.path : this.path
|
|
|
+ const query = options.query ? JSON.parse(decodeURI(options.query)) : {}
|
|
|
+ const queryArr = []
|
|
|
+ for (const queryKey in query) {
|
|
|
+ queryArr.push(`${queryKey}=${query[queryKey]}`)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.path = this.path + '?' + queryArr.join('&')
|
|
|
+
|
|
|
this.login()
|
|
|
}
|
|
|
}
|