优化进入首页查询个人信息问题
parent
bac6a56c2e
commit
61cff4805f
1
main.js
1
main.js
|
@ -34,6 +34,7 @@ Vue.prototype.request =async ({url = '', type = '', data = {}, success}) => {
|
|||
|
||||
}
|
||||
Vue.prototype.requestToken =async ({url = '', type = '', data = {}, success,contentType="application/x-www-form-urlencoded"}) => {
|
||||
console.log(uni.getStorageSync('userData'),37);
|
||||
if(uni.getStorageSync('userData')){
|
||||
let userData=uni.getStorageSync('userData')
|
||||
uni.request({
|
||||
|
|
|
@ -113,7 +113,6 @@
|
|||
if(!uni.getStorageSync('userData')) {
|
||||
uni.login({
|
||||
success:(res)=> {
|
||||
console.log(res);
|
||||
this.request({
|
||||
url: this.host + "/api/user/login",
|
||||
type:"POST",
|
||||
|
@ -121,6 +120,8 @@
|
|||
code: res.code,
|
||||
},
|
||||
success:(data)=>{
|
||||
console.log(data,124);
|
||||
if(data.data.code!=4003) {
|
||||
uni.setStorageSync('userData',data.data.data);
|
||||
this.request({
|
||||
url: this.host + "/api/user/info",
|
||||
|
@ -132,6 +133,7 @@
|
|||
uni.setStorageSync('ifMemberPrice',this.ifSwitchMember);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.getbannerData()
|
||||
this.getNavData()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue