|
@@ -352,18 +352,19 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
Cookies.set('isWeChat', '2')
|
|
Cookies.set('isWeChat', '2')
|
|
|
}
|
|
}
|
|
|
- await this.getLogin()
|
|
|
|
|
|
|
+ // 保存URL中的重定向参数到Cookie
|
|
|
const redirectUri = this.$route.query.url ? decodeURIComponent(this.$route.query.url) : null
|
|
const redirectUri = this.$route.query.url ? decodeURIComponent(this.$route.query.url) : null
|
|
|
console.log('redirectUri from query:', redirectUri)
|
|
console.log('redirectUri from query:', redirectUri)
|
|
|
if (redirectUri && redirectUri !== 'undefined') {
|
|
if (redirectUri && redirectUri !== 'undefined') {
|
|
|
Cookies.set('redirectUri', redirectUri)
|
|
Cookies.set('redirectUri', redirectUri)
|
|
|
}
|
|
}
|
|
|
- // 如果有code参数,说明是从微信授权回调过来的
|
|
|
|
|
|
|
+ // 如果有code参数,说明是从微信授权回调过来的,直接处理回调
|
|
|
if (this.code) {
|
|
if (this.code) {
|
|
|
this.handleAuthCallback()
|
|
this.handleAuthCallback()
|
|
|
} else {
|
|
} else {
|
|
|
- // 没有code参数,开始授权流程
|
|
|
|
|
- this.startAuth()
|
|
|
|
|
|
|
+ // 没有code参数,显示授权页面让用户点击授权按钮
|
|
|
|
|
+ // 注意:不要自动调用startAuth,让用户手动点击
|
|
|
|
|
+ this.authStatus = 'init'
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|