修改小程序跳转iphone问题
parent
760eaf080d
commit
e1d337a86c
|
@ -11,11 +11,11 @@ Vue.prototype.HOME = '/api'
|
|||
// 添加请求拦截器具
|
||||
axios.interceptors.request.use(config => {
|
||||
if (config.url != "/api/api/user/login-by-Phone" && config.url != "/api/api/common/send-sms-captcha" &&config.url !='/api/api/user/has-phone-user') {
|
||||
if (!localStorage.userData) {
|
||||
if (!localStorage.token) {
|
||||
router.replace('/login');
|
||||
return config
|
||||
} else {
|
||||
config.headers.Authorization = "Bearer " + JSON.parse(localStorage.userData).token
|
||||
config.headers.Authorization = "Bearer " + JSON.parse(localStorage.token)
|
||||
}
|
||||
}
|
||||
return config
|
||||
|
|
|
@ -71,6 +71,10 @@
|
|||
}
|
||||
},
|
||||
created() {
|
||||
if(this.$route.query.token){
|
||||
let token = this.$route.query.token;
|
||||
localStorage.token = JSON.stringify(token);
|
||||
}
|
||||
this.isScroll = true;
|
||||
window.addEventListener("scroll", this.eventScrollTop);
|
||||
},
|
||||
|
|
|
@ -171,9 +171,9 @@
|
|||
};
|
||||
},
|
||||
created() {
|
||||
if(this.$route.query.userData){
|
||||
let userData = this.$route.query.userData;
|
||||
localStorage.userData = userData;
|
||||
if(this.$route.query.token){
|
||||
let token = this.$route.query.token;
|
||||
localStorage.token = JSON.stringify(token);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@
|
|||
.then(function(res) {
|
||||
console.log(res.data,252525)
|
||||
localStorage.userData = JSON.stringify(res.data.data);
|
||||
localStorage.token = JSON.stringify(res.data.data);
|
||||
if (res.data.code == 0) {
|
||||
that.getUserData();
|
||||
if(res.data.data.userType == 1){
|
||||
|
|
Loading…
Reference in New Issue