feat(api): 新增文件上传相关API及用户邮箱字段
refactor(auth): 使用isApiSuccess统一校验API响应 refactor(store): 更新用户信息获取逻辑以适配新响应格式 chore: 添加eslint和prettier配置及脚本 style: 调整vite代理配置端口号 新增文件上传相关API接口及类型定义 扩展用户信息接口添加邮箱相关字段 统一API响应校验逻辑 更新package.json添加代码格式化工具
This commit is contained in:
@@ -2,6 +2,7 @@ import { defineStore } from "pinia";
|
||||
import ACCESS_ENUM from "../access/accessEnum";
|
||||
import type { LoginUesr } from "../store/types";
|
||||
import { getUserInfoByToken } from "@/api/auth/user";
|
||||
import { isApiSuccess } from "@/api/response";
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -23,8 +24,8 @@ export const useUserStore = defineStore("user", {
|
||||
try {
|
||||
const res = await getUserInfoByToken();
|
||||
console.log("获取登录用户成功", res);
|
||||
if(res.data.success === true){
|
||||
this.updateUserLoginStatus(res.data.data);
|
||||
if (isApiSuccess(res)) {
|
||||
this.updateUserLoginStatus(res.data);
|
||||
}
|
||||
}catch(e) {
|
||||
console.error("获取登录用户失败", e);
|
||||
|
||||
Reference in New Issue
Block a user