feat: 修改Cookie文字

This commit is contained in:
alger
2025-08-07 22:55:53 +08:00
parent 3ba85f34ed
commit 1597fbf108
2 changed files with 5 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ const loginByToken = async () => {
if (user.data && user.data.profile) {
const successMsg = t('login.message.tokenLoginSuccess');
message.success(successMsg);
emit('loginSuccess', user.data.profile, 'token');
emit('loginSuccess', user.data.profile, 'cookie');
} else {
// token无效清除localStorage
localStorage.removeItem('token');

View File

@@ -68,7 +68,7 @@
<!-- Cookie登录组件 -->
<div
v-else-if="activeMode === LoginMode.TOKEN && !isTransitioning"
v-else-if="activeMode === LoginMode.COOKIE && !isTransitioning"
key="token"
class="phone"
>
@@ -102,7 +102,7 @@ enum LoginMode {
QR = 'qr',
PHONE = 'phone',
UID = 'uid',
TOKEN = 'token'
COOKIE = 'cookie'
}
const { t } = useI18n();
@@ -111,13 +111,13 @@ const router = useRouter();
const userStore = useUserStore();
// 当前激活的登录模式
const activeMode = ref<LoginMode>(LoginMode.TOKEN);
const activeMode = ref<LoginMode>(LoginMode.COOKIE);
// 用于控制内容切换动画
const isTransitioning = ref(false);
// 登录选项配置
const loginTabs = computed(() => [
{ key: LoginMode.TOKEN, label: t('login.title.cookie') },
{ key: LoginMode.COOKIE, label: t('login.title.cookie') },
{ key: LoginMode.UID, label: t('login.title.uid') },
{ key: LoginMode.QR, label: t('login.title.qr') }
]);