优化进入首页查询个人信息问题
							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"}) => { | Vue.prototype.requestToken =async ({url = '', type = '', data = {}, success,contentType="application/x-www-form-urlencoded"}) => { | ||||||
|  | 	console.log(uni.getStorageSync('userData'),37); | ||||||
|    if(uni.getStorageSync('userData')){ |    if(uni.getStorageSync('userData')){ | ||||||
|        let userData=uni.getStorageSync('userData') |        let userData=uni.getStorageSync('userData') | ||||||
|      uni.request({ |      uni.request({ | ||||||
|  |  | ||||||
|  | @ -113,7 +113,6 @@ | ||||||
| 				if(!uni.getStorageSync('userData')) { | 				if(!uni.getStorageSync('userData')) { | ||||||
| 					uni.login({ | 					uni.login({ | ||||||
| 						success:(res)=> { | 						success:(res)=> { | ||||||
| 							console.log(res); |  | ||||||
| 							this.request({ | 							this.request({ | ||||||
| 							    url: this.host + "/api/user/login", | 							    url: this.host + "/api/user/login", | ||||||
| 							    type:"POST", | 							    type:"POST", | ||||||
|  | @ -121,17 +120,20 @@ | ||||||
| 							        code: res.code, | 							        code: res.code, | ||||||
| 							    }, | 							    }, | ||||||
| 							    success:(data)=>{ | 							    success:(data)=>{ | ||||||
| 									uni.setStorageSync('userData',data.data.data); | 									console.log(data,124); | ||||||
| 									this.request({ | 									if(data.data.code!=4003) { | ||||||
| 									    url: this.host + "/api/user/info", | 										uni.setStorageSync('userData',data.data.data); | ||||||
| 									    type: "post", | 										this.request({ | ||||||
| 									    success: (res) => { | 										    url: this.host + "/api/user/info", | ||||||
| 											res.data.data.is_vip ? this.ifMember = true : this.ifMember = false; | 										    type: "post", | ||||||
| 											uni.setStorageSync('ifMember',this.ifMember); | 										    success: (res) => { | ||||||
| 											res.data.data.vip_switch ? this.ifSwitchMember = true : this.ifSwitchMember = false; | 												res.data.data.is_vip ? this.ifMember = true : this.ifMember = false; | ||||||
| 											uni.setStorageSync('ifMemberPrice',this.ifSwitchMember); | 												uni.setStorageSync('ifMember',this.ifMember); | ||||||
| 									    } | 												res.data.data.vip_switch ? this.ifSwitchMember = true : this.ifSwitchMember = false; | ||||||
| 									}) | 												uni.setStorageSync('ifMemberPrice',this.ifSwitchMember); | ||||||
|  | 										    } | ||||||
|  | 										}) | ||||||
|  | 									} | ||||||
| 									this.getbannerData() | 									this.getbannerData() | ||||||
| 									this.getNavData() | 									this.getNavData() | ||||||
| 							    } | 							    } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue