Browse Source

fix: 缓存用户名

master
guoapeng 2 weeks ago
parent
commit
280474912f
  1. 3
      src/views/login/index.vue

3
src/views/login/index.vue

@ -25,7 +25,7 @@ const keyboardVisible = ref(false)
const keyboardType = ref<'text' | 'number'>('text') const keyboardType = ref<'text' | 'number'>('text')
const softKeyboardRef = ref() const softKeyboardRef = ref()
const loginForm = ref<Record<string, any>>({ const loginForm = ref<Record<string, any>>({
name: import.meta.env.FT_NODE_ENV !== 'prod' ? 'admin' : '',
name: import.meta.env.FT_NODE_ENV !== 'prod' ? 'admin' : localStorage.getItem('username') || '',
pwd: import.meta.env.FT_NODE_ENV !== 'prod' ? '9973' : '', pwd: import.meta.env.FT_NODE_ENV !== 'prod' ? '9973' : '',
}) })
const focusedInput = ref<string | null>(null) const focusedInput = ref<string | null>(null)
@ -66,6 +66,7 @@ const loginHandle = async () => {
deviceStore.setDeviceState(res.rely.loginUser) deviceStore.setDeviceState(res.rely.loginUser)
} }
await router.push('/home') await router.push('/home')
localStorage.setItem('username', loginForm.value.name)
loading.value = false loading.value = false
}) })
} }

Loading…
Cancel
Save