瀏覽代碼

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

疯狂的狮子Li 1 年之前
父節點
當前提交
e10f112fa0
共有 1 個文件被更改,包括 4 次插入4 次删除
  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;
 }