Jelajahi Sumber

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

疯狂的狮子Li 1 tahun lalu
induk
melakukan
e10f112fa0
1 mengubah file dengan 4 tambahan dan 4 penghapusan
  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;
 }