修改小程序跳转iphone问题

master
Lee-1203 2022-03-09 18:24:18 +08:00
parent 760eaf080d
commit e1d337a86c
4 changed files with 10 additions and 5 deletions

View File

@ -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

View File

@ -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);
},

View File

@ -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);
}

View File

@ -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){