From 12cf68ea971e5c39e884474734ef51cbc52bec8d Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期六, 23 三月 2024 18:05:29 +0800
Subject: [PATCH] 登录接口重新联调

---
 src/views/other/login/index.vue |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/views/other/login/index.vue b/src/views/other/login/index.vue
index 794c981..df4544e 100644
--- a/src/views/other/login/index.vue
+++ b/src/views/other/login/index.vue
@@ -145,31 +145,32 @@
      */
     // 鎻愪氦鐧诲綍淇℃伅
     submit() {
-      this.$refs.loginForm.validate((valid) => {
+      this.$refs.loginForm.validate(async (valid) => {
         if (valid) {
           // 鐧诲綍
-          // 娉ㄦ剰 杩欓噷鐨勬紨绀烘病鏈変紶楠岃瘉鐮�
-          // 鍏蜂綋闇�瑕佷紶閫掔殑鏁版嵁璇疯嚜琛屼慨鏀逛唬鐮�
-          login({
+          await login({
             username: this.formLogin.username,
             password: this.formLogin.password,
             captcha: this.formLogin.code,
             captchaId: this.captchaId
-          }).then((rsp) => {
-            // 閲嶅畾鍚戝璞′笉瀛樺湪鍒欒繑鍥為《灞傝矾寰�
-            if (rsp != "") {
-              // this.$message.warning(rsp);
-              this.error = "濉叆淇℃伅閿欒锛岃妫�鏌ワ紒"
-              let _this = this
-              setTimeout(function () {
-                _this.error = ""
-              }, 3000)
-              if (rsp.indexOf("楠岃瘉鐮侀敊璇�") > -1) {
+          }).then((res) => {
+            console.log(res, "dddd")
+            if (res.code == 200) {
+              console.log(res, "8888")
+              this.$message.success("鐧诲綍鎴愬姛")
+              localStorage.setItem("token", res.data.token)
+              localStorage.setItem("username", res.data.user.username)
+              localStorage.setItem("uuid", res.data.user.id)
+              setTimeout(() => {
+                this.$router.push({ path: "/orderManageModule/orderManage" })
+              }, 2000)
+            } else {
+              this.$message.warning(res.msg)
+              if (res.msg == "楠岃瘉鐮侀敊璇�") {
                 this.getCaptchaData()
               }
               return
             }
-            this.$router.push({ path: "/commonWeb" })
           })
         } else {
           // 鐧诲綍琛ㄥ崟鏍¢獙澶辫触

--
Gitblit v1.8.0