mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-15 13:43:48 +08:00
v2.0
This commit is contained in:
14
web/src/enums/apiEnum.ts
Normal file
14
web/src/enums/apiEnum.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export enum ApiEnum {
|
||||
// api前缀
|
||||
Prefix = '/api',
|
||||
|
||||
// 基础
|
||||
SiteLogin = '/site/login', // 登录
|
||||
SiteConfig = '/site/config', // 配置信息
|
||||
|
||||
// 会员
|
||||
MemberInfo = '/member/info', // 登录会员信息
|
||||
|
||||
// 角色
|
||||
RoleDynamic = '/role/dynamic', // 动态路由
|
||||
}
|
||||
28
web/src/enums/breakpointEnum.ts
Normal file
28
web/src/enums/breakpointEnum.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
export enum sizeEnum {
|
||||
XS = 'XS',
|
||||
SM = 'SM',
|
||||
MD = 'MD',
|
||||
LG = 'LG',
|
||||
XL = 'XL',
|
||||
XXL = 'XXL',
|
||||
}
|
||||
|
||||
export enum screenEnum {
|
||||
XS = 480,
|
||||
SM = 576,
|
||||
MD = 768,
|
||||
LG = 992,
|
||||
XL = 1200,
|
||||
XXL = 1600,
|
||||
}
|
||||
|
||||
const screenMap = new Map<sizeEnum, number>();
|
||||
|
||||
screenMap.set(sizeEnum.XS, screenEnum.XS);
|
||||
screenMap.set(sizeEnum.SM, screenEnum.SM);
|
||||
screenMap.set(sizeEnum.MD, screenEnum.MD);
|
||||
screenMap.set(sizeEnum.LG, screenEnum.LG);
|
||||
screenMap.set(sizeEnum.XL, screenEnum.XL);
|
||||
screenMap.set(sizeEnum.XXL, screenEnum.XXL);
|
||||
|
||||
export { screenMap };
|
||||
20
web/src/enums/cacheEnum.ts
Normal file
20
web/src/enums/cacheEnum.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// token key
|
||||
export const TOKEN_KEY = 'TOKEN';
|
||||
|
||||
// member info key
|
||||
export const USER_INFO_KEY = 'USER__INFO__';
|
||||
|
||||
// role info key
|
||||
export const ROLES_KEY = 'ROLES__KEY__';
|
||||
|
||||
// project config key
|
||||
export const PROJ_CFG_KEY = 'PROJ__CFG__KEY__';
|
||||
|
||||
// lock info
|
||||
export const LOCK_INFO_KEY = 'LOCK__INFO__KEY__';
|
||||
|
||||
// base global local key
|
||||
export const BASE_LOCAL_CACHE_KEY = 'LOCAL__CACHE__KEY__';
|
||||
|
||||
// base global session key
|
||||
export const BASE_SESSION_CACHE_KEY = 'SESSION__CACHE__KEY__';
|
||||
34
web/src/enums/httpEnum.ts
Normal file
34
web/src/enums/httpEnum.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @description: 请求结果集
|
||||
*/
|
||||
export enum ResultEnum {
|
||||
SUCCESS = 0,
|
||||
ERROR = -1,
|
||||
TIMEOUT = 61,
|
||||
TYPE = 'success',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 请求方法
|
||||
*/
|
||||
export enum RequestEnum {
|
||||
GET = 'GET',
|
||||
POST = 'POST',
|
||||
PATCH = 'PATCH',
|
||||
PUT = 'PUT',
|
||||
DELETE = 'DELETE',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 常用的contentTyp类型
|
||||
*/
|
||||
export enum ContentTypeEnum {
|
||||
// json
|
||||
JSON = 'application/json;charset=UTF-8',
|
||||
// json
|
||||
TEXT = 'text/plain;charset=UTF-8',
|
||||
// form-data 一般配合qs
|
||||
FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
// form-data 上传
|
||||
FORM_DATA = 'multipart/form-data;charset=UTF-8',
|
||||
}
|
||||
67
web/src/enums/optionsiEnum.ts
Normal file
67
web/src/enums/optionsiEnum.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
export const switchOptions = [
|
||||
{
|
||||
value: 1,
|
||||
label: '已开启',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已关闭',
|
||||
},
|
||||
].map((s) => {
|
||||
return s;
|
||||
});
|
||||
|
||||
export const sexOptions = [
|
||||
{
|
||||
value: 1,
|
||||
label: '男',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '女',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '未知',
|
||||
},
|
||||
].map((s) => {
|
||||
return s;
|
||||
});
|
||||
|
||||
export const statusOptions = [
|
||||
{
|
||||
value: 1,
|
||||
label: '正常',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已禁用',
|
||||
},
|
||||
].map((s) => {
|
||||
return s;
|
||||
});
|
||||
|
||||
export const hiddenOptions = [
|
||||
{
|
||||
value: 1,
|
||||
label: '是',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '否',
|
||||
},
|
||||
].map((s) => {
|
||||
return s;
|
||||
});
|
||||
|
||||
// 操作类
|
||||
export const statusActions = [
|
||||
{
|
||||
label: '设为启用',
|
||||
key: 1,
|
||||
},
|
||||
{
|
||||
label: '设为禁用',
|
||||
key: 2,
|
||||
},
|
||||
];
|
||||
14
web/src/enums/pageEnum.ts
Normal file
14
web/src/enums/pageEnum.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export enum PageEnum {
|
||||
// 登录
|
||||
BASE_LOGIN = '/login',
|
||||
BASE_LOGIN_NAME = 'Login',
|
||||
//重定向
|
||||
REDIRECT = '/redirect',
|
||||
REDIRECT_NAME = 'Redirect',
|
||||
// 首页
|
||||
BASE_HOME = '/dashboard',
|
||||
//首页跳转默认路由
|
||||
BASE_HOME_REDIRECT = '/dashboard/console',
|
||||
// 错误
|
||||
ERROR_PAGE_NAME = 'ErrorPage',
|
||||
}
|
||||
4
web/src/enums/permissionsEnum.ts
Normal file
4
web/src/enums/permissionsEnum.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface PermissionsEnum {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
7
web/src/enums/roleEnum.ts
Normal file
7
web/src/enums/roleEnum.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export enum RoleEnum {
|
||||
// 管理员
|
||||
ADMIN = 'admin',
|
||||
|
||||
// 普通用户
|
||||
NORMAL = 'normal',
|
||||
}
|
||||
16
web/src/enums/socketEnum.ts
Normal file
16
web/src/enums/socketEnum.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export enum SocketEnum {
|
||||
EventPing = 'ping',
|
||||
EventConnected = 'connected',
|
||||
EventAdminMonitorTrends = 'adminMonitorTrends',
|
||||
EventAdminMonitorRunInfo = 'adminMonitorRunInfo',
|
||||
TypeQueryUser = 2,
|
||||
TypeBoardCastMsg = 3,
|
||||
TypeQuerySwitcher = 4,
|
||||
TypeQueryEndlessRank = 5,
|
||||
TypeSendEmail = 6,
|
||||
TypeQueryUserGuide = 7,
|
||||
TypeRestartLog = 90,
|
||||
HeartBeatInterval = 1000,
|
||||
CodeSuc = 0,
|
||||
CodeErr = -1,
|
||||
}
|
||||
Reference in New Issue
Block a user