From 1f25c95c05db7875dce7902d7e00ecaf8f9f4355 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期六, 04 二月 2023 22:33:47 +0800 Subject: [PATCH] update copyright 2023 --- src/views/login.vue | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/views/login.vue b/src/views/login.vue index 73000f5..c2a91ef 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -25,7 +25,7 @@ <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template> </el-input> </el-form-item> - <el-form-item prop="code" v-if="captchaOnOff"> + <el-form-item prop="code" v-if="captchaEnabled"> <el-input v-model="loginForm.code" size="large" @@ -59,7 +59,7 @@ </el-form> <!-- 搴曢儴 --> <div class="el-login-footer"> - <span>Copyright 漏 2018-2022 ruoyi.vip All Rights Reserved.</span> + <span>Copyright 漏 2018-2023 ruoyi.vip All Rights Reserved.</span> </div> </div> </template> @@ -68,8 +68,9 @@ import { getCodeImg } from "@/api/login"; import Cookies from "js-cookie"; import { encrypt, decrypt } from "@/utils/jsencrypt"; +import useUserStore from '@/store/modules/user' -const store = useStore(); +const userStore = useUserStore() const router = useRouter(); const { proxy } = getCurrentInstance(); @@ -90,7 +91,7 @@ const codeUrl = ref(""); const loading = ref(false); // 楠岃瘉鐮佸紑鍏� -const captchaOnOff = ref(true); +const captchaEnabled = ref(true); // 娉ㄥ唽寮�鍏� const register = ref(false); const redirect = ref(undefined); @@ -99,7 +100,7 @@ proxy.$refs.loginRef.validate(valid => { if (valid) { loading.value = true; - // 鍕鹃�変簡闇�瑕佽浣忓瘑鐮佽缃湪cookie涓缃浣忕敤鎴锋槑鍜屽悕鍛� + // 鍕鹃�変簡闇�瑕佽浣忓瘑鐮佽缃湪 cookie 涓缃浣忕敤鎴峰悕鍜屽瘑鐮� if (loginForm.value.rememberMe) { Cookies.set("username", loginForm.value.username, { expires: 30 }); Cookies.set("password", encrypt(loginForm.value.password), { expires: 30 }); @@ -111,12 +112,12 @@ Cookies.remove("rememberMe"); } // 璋冪敤action鐨勭櫥褰曟柟娉� - store.dispatch("Login", loginForm.value).then(() => { + userStore.login(loginForm.value).then(() => { router.push({ path: redirect.value || "/" }); }).catch(() => { loading.value = false; // 閲嶆柊鑾峰彇楠岃瘉鐮� - if (captchaOnOff.value) { + if (captchaEnabled.value) { getCode(); } }); @@ -126,8 +127,8 @@ function getCode() { getCodeImg().then(res => { - captchaOnOff.value = res.captchaOnOff === undefined ? true : res.captchaOnOff; - if (captchaOnOff.value) { + captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled; + if (captchaEnabled.value) { codeUrl.value = "data:image/gif;base64," + res.img; loginForm.value.uuid = res.uuid; } @@ -211,4 +212,4 @@ height: 40px; padding-left: 12px; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3