Commit fa17e386 authored by 肖健's avatar 肖健

修复登录后未跳转的问题

parent eda800c7
......@@ -150,9 +150,8 @@ export default {
url: '/pages/main'
})
},
checkLogin() {
let token = uni.getStorageSync('userToken')
if(!token) {
goToLogin() {
uni.setStorageSync('routerLogin', '/pagesA/pages/popAct/index')
uni.setStorageSync('routerLoginPageType', 'switchTab')
//跳转到登录页
let returnPage = '/pages/main';
......@@ -160,9 +159,6 @@ export default {
uni.navigateTo({
url: "/pages/login/index/index?returnPage=" + returnPage + '&pageType=' + pageType
})
return null
}
return 1
},
// 选择爱车
radioChange(item){
......@@ -173,8 +169,12 @@ export default {
},
// 获取爱车列表
getCarList(){
let v = this.checkLogin()
if(v) {
let token = uni.getStorageSync('userToken')
if(!token) {
this.goToLogin()
return
}
this.$http.request({
url:'/app/vehicleAdmin/list',
method:'get',
......@@ -184,7 +184,6 @@ export default {
this.carList = res.data || []
this.selectCar = true
})
}
},
// 添加车辆
addCar() {
......@@ -235,8 +234,9 @@ export default {
//活动检查信息
submitAct() {
let that = this
let v = that.checkLogin()
if(!v) {
let token = uni.getStorageSync('userToken')
if(!token) {
that.goToLogin()
return
}
that.$refs.form1.validate().then(res => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment