Ver código fonte

自动登录bug

cz 1 ano atrás
pai
commit
174860c2cc
2 arquivos alterados com 15 adições e 8 exclusões
  1. 4 2
      src/views/login.vue
  2. 11 6
      src/views/working/index.vue

+ 4 - 2
src/views/login.vue

@@ -178,11 +178,13 @@ onMounted(() => {
     // langModal.value = true;
     changeLang();
   }
-  if (rememberMeCopy) {
+
+  if (rememberMeCopy == "true") {
     loginForm.value.username = username;
     loginForm.value.password = password;
     rememberMe.value = true;
     loginForm.value.tenantId = tenantId;
+    onSubmit();
   } else {
     loginForm.value.username = "";
     loginForm.value.password = "";
@@ -219,5 +221,5 @@ const ddLoginInit = () => {
     });
   });
 };
-ddLoginInit();
+// ddLoginInit();
 </script>

+ 11 - 6
src/views/working/index.vue

@@ -45,6 +45,7 @@ export default {
 };
 </script>
 <script setup name="working">
+import { showSuccessToast, showFailToast } from "vant";
 import { nextTick, onMounted } from "vue";
 import { ref, reactive, getCurrentInstance, toRaw, onActivated } from "vue";
 const proxy = getCurrentInstance().proxy;
@@ -123,12 +124,16 @@ const toRouter = (item) => {
 };
 
 const showScanData = (val) => {
-  proxy.$router.push({
-    path: "/main/productionReportAdd",
-    query: {
-      id: val,
-    },
-  });
+  if (val) {
+    proxy.$router.push({
+      path: "/main/productionReportAdd",
+      query: {
+        id: val,
+      },
+    });
+  } else {
+    return showFailToast("内容为空");
+  }
 };
 
 onMounted(() => {