Ver Fonte

记住密码

gcz há 1 ano atrás
pai
commit
5da8504e29
1 ficheiros alterados com 13 adições e 3 exclusões
  1. 13 3
      pages/login/login.vue

+ 13 - 3
pages/login/login.vue

@@ -103,6 +103,12 @@
 					console.log('backUrl',that.backUrl);
 				}
 			});
+			uni.getStorage({
+				key:'mobile',
+				success: (res) => {
+					that.form.mobile = res.data
+				}
+			})
 			// console.log('accessToken=====',this.vuex_user_info.accessToken);
 			let accessToken = this.vuex_user_info.accessToken;
 			if(accessToken){
@@ -160,7 +166,11 @@
 				
 				this.loading = true
 				this.$refs.uForm.validate().then(res => {
-					this.$u.toast('校验通过')
+					this.$u.toast('校验通过');
+					uni.setStorage({
+						key:'mobile',
+						data:this.form.mobile
+					});
 					this.$u.api.teamLogin(this.form).then(res=>{
 						this.loading = false
 						// console.log('res',res.data);
@@ -168,11 +178,11 @@
 						uni.reLaunch({url: this.backUrl});
 					}).catch(err=>{
 						console.log('login',err);
-						this.$u.toast(err.msg)
+						this.$u.toast(err.msg);
+						this.loading = false;
 						setTimeout(()=>{
 							this.redirectToAuth();
 						},1500)
-						this.loading = false
 					})
 				}).catch(errors => {
 					this.$u.toast('校验失败')