最近一丢丢

This commit is contained in:
ah--desktop
2025-09-16 23:01:25 +08:00
parent 2b750585d1
commit dde50d2bd6
30 changed files with 1518 additions and 659 deletions
@@ -12,6 +12,7 @@ import { defineStore } from 'pinia';
import { getAccessCodesApi, getUserInfoApi, loginApi, logoutApi, registerApi } from '#/api';
import { $t } from '#/locales';
import type { AuthApi } from '#/api/core/auth';
export const useAuthStore = defineStore('auth', () => {
const accessStore = useAccessStore();
@@ -33,7 +34,12 @@ export const useAuthStore = defineStore('auth', () => {
let userInfo: null | UserInfo = null;
try {
loginLoading.value = true;
const { token, user } = await loginApi(params as any);
// 只提取必要的登录字段
const loginParams: AuthApi.LoginParams = {
account: params.account,
password: params.password,
};
const { token, user } = await loginApi(loginParams);
// 如果成功获取到 token
if (token) {