mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
perf: 优化免登录功能,用户可选择免登录的天数
This commit is contained in:
@@ -44,6 +44,7 @@ defineOptions({
|
||||
});
|
||||
|
||||
const imgCode = ref("");
|
||||
const loginDay = ref(7);
|
||||
const router = useRouter();
|
||||
const loading = ref(false);
|
||||
const checked = ref(false);
|
||||
@@ -111,6 +112,9 @@ watch(imgCode, value => {
|
||||
watch(checked, bool => {
|
||||
useUserStoreHook().SET_ISREMEMBERED(bool);
|
||||
});
|
||||
watch(loginDay, value => {
|
||||
useUserStoreHook().SET_LOGINDAY(value);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -230,6 +234,19 @@ watch(checked, bool => {
|
||||
<div class="w-full h-[20px] flex justify-between items-center">
|
||||
<el-checkbox v-model="checked">
|
||||
<span class="flex">
|
||||
<select
|
||||
v-model="loginDay"
|
||||
:style="{
|
||||
width: loginDay < 10 ? '10px' : '16px',
|
||||
outline: 'none',
|
||||
background: 'none',
|
||||
appearance: 'none'
|
||||
}"
|
||||
>
|
||||
<option value="1">1</option>
|
||||
<option value="7">7</option>
|
||||
<option value="30">30</option>
|
||||
</select>
|
||||
{{ t("login.remember") }}
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
|
||||
Reference in New Issue
Block a user