mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 21:09:19 +08:00
最近一丢丢
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user