mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-14 14:50:50 +08:00
feat: 修改Cookie文字
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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') }
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user