ref : 重构令牌管理逻辑,,统一状态码识别

This commit is contained in:
TsMask
2025-04-27 17:23:33 +08:00
parent f76311cf1b
commit 2de9788373
23 changed files with 229 additions and 253 deletions

View File

@@ -1,14 +1,14 @@
/**响应-code加密数据 */
export const RESULT_CODE_ENCRYPT = 2;
export const RESULT_CODE_ENCRYPT = 200999;
/**响应-msg加密数据 */
export const RESULT_MSG_ENCRYPT: Record<string, string> = {
zh_CN: '加密!',
en_US: 'encrypt!',
en_US: 'Encrypt!',
};
/**响应-code正常成功 */
export const RESULT_CODE_SUCCESS = 1;
export const RESULT_CODE_SUCCESS = 200001;
/**响应-msg正常成功 */
export const RESULT_MSG_SUCCESS: Record<string, string> = {
@@ -17,7 +17,16 @@ export const RESULT_MSG_SUCCESS: Record<string, string> = {
};
/**响应-code错误失败 */
export const RESULT_CODE_ERROR = 0;
export const RESULT_CODE_ERROR = 400001;
/**响应-code错误异常 */
export const RESULT_CODE_EXCEPTION = 500001;
/**响应-服务器连接出错 */
export const RESULT_MSG_SERVER_ERROR: Record<string, string> = {
zh_CN: '服务器连接出错!',
en_US: 'Server Connection Error!',
};
/**响应-msg错误失败 */
export const RESULT_MSG_ERROR: Record<string, string> = {
@@ -37,18 +46,6 @@ export const RESULT_MSG_NOT_TYPE: Record<string, string> = {
en_US: 'Unknown Response Data Type!',
};
/**响应-服务器连接出错 */
export const RESULT_MSG_SERVER_ERROR: Record<string, string> = {
zh_CN: '服务器连接出错!',
en_US: 'Server Connection Error!',
};
/**响应-请求地址未找到 */
export const RESULT_MSG_URL_NOTFOUND: Record<string, string> = {
zh_CN: '请求地址未找到!',
en_US: 'Request Address Not Found!',
};
/**响应-数据正在处理,请勿重复提交 */
export const RESULT_MSG_URL_RESUBMIT: Record<string, string> = {
zh_CN: '数据正在处理,请勿重复提交!',

View File

@@ -2,10 +2,13 @@
export const TOKEN_RESPONSE_FIELD = 'accessToken';
/**令牌-请求头标识前缀 */
export const TOKEN_KEY_PREFIX = 'Bearer ';
export const TOKEN_KEY_PREFIX = 'Bearer';
/**令牌-请求头标识 */
export const TOKEN_KEY = 'Authorization';
/**令牌-存放Cookie标识 */
export const TOKEN_COOKIE = 'AuthOMC';
/**令牌-访问令牌存放Cookie标识 */
export const TOKEN_ACCESS_COOKIE = 'omc_access';
/**令牌-刷新令牌存放Cookie标识 */
export const TOKEN_REFRESH_COOKIE = 'omc_refresh';