项目微调

This commit is contained in:
2024-08-23 10:29:26 +08:00
parent 88d134b43b
commit 976a7708cd
10 changed files with 27 additions and 68 deletions

View File

@@ -0,0 +1,5 @@
// 系统&用户模块前缀
export const ADMIN = "/admin";
// todo... 其他业务模块前缀

View File

@@ -1,2 +0,0 @@
// 后端微服务模块前缀
export const PORT1 = "/admin";

View File

@@ -1,5 +1,5 @@
import { Login } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { ADMIN } from "@/api/config/serviceName";
import http from "@/api";
/**
@@ -7,20 +7,20 @@ import http from "@/api";
*/
// 用户登录
export const loginApi = (params: Login.ReqLoginForm) => {
return http.post<Login.ResLogin>(PORT1 + `/login`, params, { loading: false }); // 正常 post json 请求 ==> application/json
return http.post<Login.ResLogin>(ADMIN + `/login`, params, { loading: false }); // 正常 post json 请求 ==> application/json
};
// 获取菜单列表
export const getAuthMenuListApi = () => {
return http.get<Menu.MenuOptions[]>(PORT1 + `/menu/list`, {}, { loading: false });
return http.get<Menu.MenuOptions[]>(ADMIN + `/menu/list`, {}, { loading: false });
};
// 获取按钮权限
export const getAuthButtonListApi = () => {
return http.get<Login.ResAuthButtons>(PORT1 + `/auth/buttons`, {}, { loading: false });
return http.get<Login.ResAuthButtons>(ADMIN + `/auth/buttons`, {}, { loading: false });
};
// 用户退出登录
export const logoutApi = () => {
return http.post(PORT1 + `/logout`);
return http.post(ADMIN + `/logout`);
};

View File

@@ -1,16 +0,0 @@
import { Upload } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";
/**
* @name 文件上传模块
*/
// 图片上传
export const uploadImg = (params: FormData) => {
return http.post<Upload.ResFileUrl>(PORT1 + `/file/upload/img`, params);
};
// 视频上传
export const uploadVideo = (params: FormData) => {
return http.post<Upload.ResFileUrl>(PORT1 + `/file/upload/video`, params);
};

View File

@@ -1,5 +1,5 @@
import { ResPage, User } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { ADMIN } from "@/api/config/serviceName";
import http from "@/api";
/**
@@ -7,65 +7,65 @@ import http from "@/api";
*/
// 获取用户列表
export const getUserList = (params: User.ReqUserParams) => {
return http.post<ResPage<User.ResUserList>>(PORT1 + `/user/list`, params);
return http.post<ResPage<User.ResUserList>>(ADMIN + `/user/list`, params);
};
// 获取树形用户列表
export const getUserTreeList = (params: User.ReqUserParams) => {
return http.post<ResPage<User.ResUserList>>(PORT1 + `/user/tree/list`, params);
return http.post<ResPage<User.ResUserList>>(ADMIN + `/user/tree/list`, params);
};
// 新增用户
export const addUser = (params: { id: string }) => {
return http.post(PORT1 + `/user/add`, params);
return http.post(ADMIN + `/user/add`, params);
};
// 批量添加用户
export const BatchAddUser = (params: FormData) => {
return http.post(PORT1 + `/user/import`, params);
return http.post(ADMIN + `/user/import`, params);
};
// 编辑用户
export const editUser = (params: { id: string }) => {
return http.post(PORT1 + `/user/edit`, params);
return http.post(ADMIN + `/user/edit`, params);
};
// 删除用户
export const deleteUser = (params: { id: string[] }) => {
return http.post(PORT1 + `/user/delete`, params);
return http.post(ADMIN + `/user/delete`, params);
};
// 切换用户状态
export const changeUserStatus = (params: { id: string; status: number }) => {
return http.post(PORT1 + `/user/change`, params);
return http.post(ADMIN + `/user/change`, params);
};
// 重置用户密码
export const resetUserPassWord = (params: { id: string }) => {
return http.post(PORT1 + `/user/rest_password`, params);
return http.post(ADMIN + `/user/rest_password`, params);
};
// 导出用户数据
export const exportUserInfo = (params: User.ReqUserParams) => {
return http.download(PORT1 + `/user/export`, params);
return http.download(ADMIN + `/user/export`, params);
};
// 获取用户状态字典
export const getUserStatus = () => {
return http.get<User.ResStatus[]>(PORT1 + `/user/status`);
return http.get<User.ResStatus[]>(ADMIN + `/user/status`);
};
// 获取用户性别字典
export const getUserGender = () => {
return http.get<User.ResGender[]>(PORT1 + `/user/gender`);
return http.get<User.ResGender[]>(ADMIN + `/user/gender`);
};
// 获取用户部门列表
export const getUserDepartment = () => {
return http.get<User.ResDepartment[]>(PORT1 + `/user/department`);
return http.get<User.ResDepartment[]>(ADMIN + `/user/department`);
};
// 获取用户角色字典
export const getUserRole = () => {
return http.get<User.ResRole[]>(PORT1 + `/user/role`);
return http.get<User.ResRole[]>(ADMIN + `/user/role`);
};

View File

@@ -1,17 +0,0 @@
/**
* 本地缓存Key
*/
// 用户信息
export const USER_INFO = 'userInfo'
// 用户信息
export const TABS_INFO = 'tabsInfo'
// WEB端布局配置
export const STORE_CONFIG = 'storeConfig'
// 后台标签页
export const STORE_TAB_VIEW_CONFIG = 'storeTabViewConfig'
// 字典
export const DICT_DATA = 'dictData'

View File

@@ -1,6 +0,0 @@
/**
* 用户相关的一些常量
*/
// 请求头token拼接的前缀
export const TOKEN_PREFIX = 'bearer '

View File

@@ -12,12 +12,12 @@
// background-color: var(--el-header-bg-color);
background-color: var(--el-color-primary); //默认蓝色风格背景
.logo {
width: 210px;
padding:0 10px 0 15px;
margin-right: 30px;
.logo-img {
width: 28px;
object-fit: contain;
margin-right: 6px;
margin-right: 5px;
}
.logo-text {
font-size: 21.5px;