From 910f2ef56d0d49a4ce24b2f33860dce4d739b1b4 Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期三, 03 八月 2022 16:58:06 +0800
Subject: [PATCH] 项目整体细节,新增主页煤仓剩余量图表。

---
 pages/login/login.vue |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/pages/login/login.vue b/pages/login/login.vue
index 4fa24d9..8b68493 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -24,12 +24,22 @@
 			formData:{
 				username:'fyy',
 				password:'123456!@#'
+        // username:'anjianwei',
+        // password:'123456'
 			}
 		};
 	},
+  onShow(){
+	  // 娓呴櫎缂撳瓨
+    if(uni.getStorageSync('userInfo')||uni.getStorageSync('access_token')||uni.getStorageSync('refresh_token')){
+      this.$u.toast('鎴愬姛杩涘叆鐧诲綍椤�');
+      uni.clearStorageSync();
+    }
+  },
 	methods:{
 		loginSubmit(){
-			// console.log('login');
+      console.log('鐐瑰嚮鐧诲綍');
+      // console.log('login');
 			uni.showLoading({
 				title:'鐧诲綍涓�...'
 			});
@@ -46,14 +56,22 @@
 					setTokenType(token_type);
 					setRefreshToken(refresh_token);
 					setScope(scope);
+					this.$store.dispatch('menus')
 					redirectHome();
 					uni.hideLoading();
 				} catch (e) {
 					// error
 					console.log(e);
 				}
+			} else{
+				uni.showToast({
+					title:response.data.msg,
+					icon:'error',
+					duration:2000
+				})
 			}
 		}
+
 	}
 };
 </script>
@@ -96,7 +114,7 @@
 		}
 		.loginBtn {
 			margin-top: vww(80);
-			
+
 			button {
 				background-color: #007aff;
 				color: #ffffff;

--
Gitblit v1.9.1