Quellcode durchsuchen

fix 修复 使用 localStorage 返回值为null问题

疯狂的狮子Li vor 1 Jahr
Ursprung
Commit
e10f112fa0
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      src/views/login.vue

+ 4 - 4
src/views/login.vue

@@ -153,10 +153,10 @@ const getLoginData = () => {
   const password = localStorage.getItem('password');
   const rememberMe = localStorage.getItem('rememberMe');
   loginForm.value = {
-    tenantId: tenantId === undefined ? String(loginForm.value.tenantId) : tenantId,
-    username: username === undefined ? String(loginForm.value.username) : username,
-    password: password === undefined ? String(loginForm.value.password) : String(password),
-    rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
+    tenantId: tenantId === null ? String(loginForm.value.tenantId) : tenantId,
+    username: username === null ? String(loginForm.value.username) : username,
+    password: password === null ? String(loginForm.value.password) : String(password),
+    rememberMe: rememberMe === null ? false : Boolean(rememberMe)
   } as LoginData;
 }