From ba616e9307681da4781b7610ec3c27721d793379 Mon Sep 17 00:00:00 2001
From: guifei zhu <guifeizhu@guifeideiMac.local>
Date: 星期三, 18 九月 2024 12:13:37 +0800
Subject: [PATCH] 添加mqtt通讯

---
 pages/login/login.vue |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/pages/login/login.vue b/pages/login/login.vue
index 438a26d..d1539e1 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -34,8 +34,8 @@
 		data() {
 			return {
 				model: {
-					username: "",
-					password: ""
+					username: "tongjitang",
+					password: "123456"
 				},
 				rules: {
 					'username': {
@@ -51,7 +51,7 @@
 						trigger: ['blur', 'change']
 					},
 				},
-
+				 
 			};
 		},
 		onLoad() {
@@ -62,14 +62,14 @@
 
 		},
 
-		methods: {
+		methods: {
+		 
 			forget() {
 				uni.navigateTo({
 					url: "/pages/tabBar/demo"
 				})
 			},
-			submit() {
-
+			submit() {
 				if (this.model.username.startsWith("http")) {
 					uni.setStorageSync('baseurl', this.model.username);
 					this.model.username = null
@@ -86,7 +86,8 @@
 			},
 			login() {
 				this.$api.login(this.model).then((res) => {
-					if (res.success) {
+					if (res.success) {
+						 
 
 						console.log('request success', res)
 						uni.showToast({
@@ -97,7 +98,8 @@
 
 						uni.setStorageSync('account', this.model);
 						uni.setStorageSync('userinfo', res.result.userInfo);
-						uni.setStorageSync('token', res.result.token);
+						uni.setStorageSync('token', res.result.token);
+				 
 
 						uni.switchTab({
 							url: '/pages/tabBar/general'

--
Gitblit v1.9.3