From 8f1e5d92579da34c21a83f74b924dfd4908889c6 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 06 二月 2024 17:22:36 +0800
Subject: [PATCH] 注掉获取PLC运行数据

---
 src/views/login/loginView.vue |   34 +++++++++++++++-------------------
 1 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/src/views/login/loginView.vue b/src/views/login/loginView.vue
index 533d652..d1a3c06 100644
--- a/src/views/login/loginView.vue
+++ b/src/views/login/loginView.vue
@@ -36,7 +36,7 @@
 import { ref, reactive, onMounted } from 'vue'
 import type { FormInstance, FormRules } from 'element-plus'
 import { getCaptcha, login } from '@/api'
-import { setToken } from '@/common/utils/index'
+import { setToken, getToken } from '@/common/utils/index'
 import { ElMessage } from 'element-plus'
 import { useRouter } from 'vue-router'
 
@@ -78,11 +78,9 @@
 const captchaId = ref('')
 
 const getCaptchaData = () => {
-  getCaptcha().then((rsp) => {
-    if (rsp.code == 200) {
-      captcha.value = rsp.data.picPath
-      captchaId.value = rsp.data.captchaId
-    }
+  getCaptcha().then((rsp: any) => {
+    captcha.value = rsp?.data?.picPath
+    captchaId.value = rsp?.data?.captchaId
   })
 }
 onMounted(() => {
@@ -107,19 +105,17 @@
         password: ruleForm.pass,
         captcha: ruleForm.code,
         captchaId: captchaId.value
-      }).then((rsp) => {
-        if (rsp.code == 200) {
-          console.log(rsp)
-          setToken(rsp.token)
-          ElMessage({
-            message: '鐧诲綍鎴愬姛锛�',
-            type: 'success'
-          })
-          ruleForm.accountNumber = ''
-          ruleForm.pass = ''
-          ruleForm.code = ''
-          router.push('/')
-        }
+      }).then((rsp: any) => {
+        console.log(rsp)
+        setToken(rsp?.data?.token)
+        ElMessage({
+          message: '鐧诲綍鎴愬姛锛�',
+          type: 'success'
+        })
+        ruleForm.accountNumber = ''
+        ruleForm.pass = ''
+        ruleForm.code = ''
+        router.push('/')
       })
     } else {
       console.log('error submit!')

--
Gitblit v1.8.0