feat: 整体pure,核心功能对接完成
This commit is contained in:
12
Yi.Pure.Vue3/src/api/file.ts
Normal file
12
Yi.Pure.Vue3/src/api/file.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { http } from "@/utils/http";
|
||||
import type { ResultFile } from "@/api/result";
|
||||
|
||||
/** 上传文件*/
|
||||
export const uploadFile = (data?: object) => {
|
||||
return http.request<ResultFile>("post", "/file", {
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
||||
},
|
||||
data
|
||||
});
|
||||
};
|
||||
@@ -17,3 +17,10 @@ export type ResultPage = {
|
||||
totalCount?: number;
|
||||
};
|
||||
};
|
||||
|
||||
export type ResultFile = {
|
||||
status: number;
|
||||
data?: Array<{
|
||||
id: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ export const updatePostStatus = (id, state) => {
|
||||
|
||||
/** 删除岗位 */
|
||||
export const delPost = ids => {
|
||||
return http.request<Result>("delete", `/post`, { params: { id:ids } });
|
||||
return http.request<Result>("delete", `/post`, { params: { id: ids } });
|
||||
};
|
||||
|
||||
/** 获取岗位选择框列表 */
|
||||
|
||||
@@ -42,7 +42,7 @@ export const addUser = (data: any) => {
|
||||
|
||||
/** 查询用户个人信息 */
|
||||
export const getUserProfile = () => {
|
||||
return http.request<Result>("get", `/account`, {});
|
||||
return http.request<UserInfoResult>("get", `/account`, {});
|
||||
};
|
||||
|
||||
/** 修改用户个人信息 */
|
||||
@@ -63,3 +63,29 @@ export const updateUserPwd = (oldPassword, newPassword) => {
|
||||
};
|
||||
return http.request<Result>("put", `/account/password`, { data });
|
||||
};
|
||||
|
||||
export type UserInfoResult = {
|
||||
status: number;
|
||||
data: UserInfo;
|
||||
};
|
||||
|
||||
export type UserInfo = {
|
||||
user: {
|
||||
/** 头像 */
|
||||
icon: string;
|
||||
/** 用户名 */
|
||||
userName: string;
|
||||
/** 昵称 */
|
||||
nick: string;
|
||||
/** 邮箱 */
|
||||
email: string;
|
||||
/** 联系电话 */
|
||||
phone: string;
|
||||
/** 简介 */
|
||||
introduction: string;
|
||||
};
|
||||
/** 当前登录用户的角色 */
|
||||
roleCodes: Array<string>;
|
||||
/** 按钮级别权限 */
|
||||
permissions: Array<string>;
|
||||
};
|
||||
|
||||
@@ -55,40 +55,6 @@ export type RefreshTokenResult = {
|
||||
};
|
||||
};
|
||||
|
||||
export type UserInfo = {
|
||||
/** 头像 */
|
||||
avatar: string;
|
||||
/** 用户名 */
|
||||
username: string;
|
||||
/** 昵称 */
|
||||
nickname: string;
|
||||
/** 邮箱 */
|
||||
email: string;
|
||||
/** 联系电话 */
|
||||
phone: string;
|
||||
/** 简介 */
|
||||
description: string;
|
||||
};
|
||||
|
||||
export type UserInfoResult = {
|
||||
success: boolean;
|
||||
data: UserInfo;
|
||||
};
|
||||
|
||||
type ResultTable = {
|
||||
success: boolean;
|
||||
data?: {
|
||||
/** 列表数据 */
|
||||
list: Array<any>;
|
||||
/** 总条目数 */
|
||||
total?: number;
|
||||
/** 每页显示条目个数 */
|
||||
pageSize?: number;
|
||||
/** 当前页数 */
|
||||
currentPage?: number;
|
||||
};
|
||||
};
|
||||
|
||||
/** 登录 */
|
||||
export const getLogin = (data?: object) => {
|
||||
return http.request<LoginResult>("post", "/account/login", { data });
|
||||
@@ -107,13 +73,3 @@ export const getCodeImg = () => {
|
||||
export const refreshTokenApi = (data?: object) => {
|
||||
return http.request<RefreshTokenResult>("post", "/refresh-token", { data });
|
||||
};
|
||||
|
||||
/** 账户设置-个人信息 */
|
||||
export const getMine = (data?: object) => {
|
||||
return http.request<UserInfoResult>("get", "/mine", { data });
|
||||
};
|
||||
|
||||
/** 账户设置-个人安全日志 */
|
||||
export const getMineLogs = (data?: object) => {
|
||||
return http.request<ResultTable>("get", "/mine-logs", { data });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user