pujiaming пре 2 година
родитељ
комит
33f9a903b6
2 измењених фајлова са 16 додато и 2 уклоњено
  1. 16 0
      src/components/layout/header.vue
  2. 0 2
      src/utils/version.ts

+ 16 - 0
src/components/layout/header.vue

@@ -319,6 +319,22 @@ const loginForm = reactive<login>({
   timestamp: parseInt(`${Date.now() / 1000}`),
   smsCaptcha: undefined
 })
+watch(
+  () => user.loginFormVisible,
+  (val:boolean) => {
+    if (val) {
+      initialForm()
+    }
+  }
+)
+const initialForm = () => {
+  console.log('initialForm')
+
+  loginForm.account = ''
+  loginForm.password = ''
+  loginForm.smsCaptcha = undefined
+  loginForm.timestamp = parseInt(`${Date.now() / 1000}`)
+}
 const ruleFormRef = ref<FormInstance>()
 const login_typ = ref<'pwd'| 'sms'>('sms')
 const resetForm = (formEl: FormInstance | undefined) => {

+ 0 - 2
src/utils/version.ts

@@ -30,8 +30,6 @@ export function getVersion() {
 }
 export function getVersionFR() {
   // 或者 路由守卫afterEach 中加入
-  console.log(import.meta.env.DEV)
-
   if (import.meta.env.DEV) return
   const htmlFileUrl = `${location.origin}${location.pathname}`
   fetch(htmlFileUrl, {