CzRger 1 mēnesi atpakaļ
vecāks
revīzija
22494b4a95
2 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/App.vue
  2. 6 0
      src/views/global/login/index.vue

+ 1 - 1
src/App.vue

@@ -14,7 +14,7 @@ document.documentElement.style.setProperty(
   'var(--czr-main-color)',
 )
 const route = useRoute()
-if (route.query.vconsole == 1) {
+if (localStorage.getItem('vconsole') == 1) {
   import('vconsole').then((module) => {
     new module.default()
   })

+ 6 - 0
src/views/global/login/index.vue

@@ -146,6 +146,12 @@ const initCode = () => {
     .finally(() => {})
 }
 const onLogin = () => {
+  if (state.form.username === 'vconsole') {
+    localStorage.setItem('vconsole', '1')
+  }
+  if (state.form.username === 'unvconsole') {
+    localStorage.removeItem('vconsole')
+  }
   if (!state.loading) {
     ref_form.value
       .submit()