Browse Source

查看密码

xiaochan 1 year ago
parent
commit
e6b312a468
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/views/system/login.vue

+ 9 - 1
src/views/system/login.vue

@@ -14,7 +14,7 @@
           </template>
         </el-input>
         <el-input
-            class="security"
+            :class="showPwd ? '' : 'security'"
             ref="password"
             v-model="form.password"
             codeRs="password"
@@ -26,6 +26,12 @@
           <template #prepend>
             <i class="sfont system-mima"></i>
           </template>
+          <template #append>
+            <el-icon @click="showPwd = !showPwd">
+              <View v-if="showPwd"/>
+              <Hide v-else/>
+            </el-icon>
+          </template>
         </el-input>
         <el-button size="large" style="width: 100%" type="primary" @click="submit">登录
         </el-button>
@@ -50,11 +56,13 @@ import {ElMessage} from 'element-plus'
 import {closeWebSocket} from '@/utils/websocket'
 import {SYSTEM_CONFIG} from '@/utils/public'
 import changePassword, {checkPasswordStrength} from "@/components/system/password-layer";
+import {Hide, View} from "@element-plus/icons-vue";
 
 const store = useStore()
 const router = useRouter()
 const route = useRoute()
 const nextInputTimes = ref(null)
+const showPwd = ref(false)
 const form = reactive({
   codeRs: '',
   password: '',