Optimize code
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
const PRODUCTION_NAME = 'FatWeb'
|
||||
const TOKEN_NAME = 'JWT_TOKEN'
|
||||
const COLOR_PRODUCTION = '#00D4FF'
|
||||
const COLOR_BACKGROUND = '#F5F5F5'
|
||||
const COLOR_TOP = 'rgba(234,46,13,0.85)'
|
||||
const COLOR_FONT_MAIN = '#4D4D4D'
|
||||
const COLOR_FONT_SECONDARY = '#9E9E9E'
|
||||
const SIZE_ICON_XS = '16px'
|
||||
const SIZE_ICON_SM = '20px'
|
||||
const SIZE_ICON_MD = '24px'
|
||||
const SIZE_ICON_LG = '32px'
|
||||
const SIZE_ICON_XL = '64px'
|
||||
|
||||
/**
|
||||
* Response code
|
||||
*/
|
||||
const SYSTEM_OK = 10000
|
||||
const SYSTEM_LOGIN_SUCCESS = 10020
|
||||
const SYSTEM_PASSWORD_CHANGE_SUCCESS = 10021
|
||||
const SYSTEM_LOGOUT_SUCCESS = 10022
|
||||
const SYSTEM_TOKEN_RENEW_SUCCESS = 10023
|
||||
const SYSTEM_UNAUTHORIZED = 10030
|
||||
const SYSTEM_USERNAME_NOT_FOUND = 10031
|
||||
const SYSTEM_ACCESS_DENIED = 10032
|
||||
const SYSTEM_USER_DISABLE = 10033
|
||||
const SYSTEM_LOGIN_USERNAME_PASSWORD_ERROR = 10034
|
||||
const SYSTEM_OLD_PASSWORD_NOT_MATCH = 10035
|
||||
const SYSTEM_LOGOUT_FAILED = 10036
|
||||
const SYSTEM_TOKEN_ILLEGAL = 10037
|
||||
const SYSTEM_TOKEN_HAS_EXPIRED = 10038
|
||||
const SYSTEM_REQUEST_ILLEGAL = 10040
|
||||
const SYSTEM_ARGUMENT_NOT_VALID = 10041
|
||||
const SYSTEM_ERROR = 10050
|
||||
const SYSTEM_TIMEOUT = 10051
|
||||
|
||||
export {
|
||||
PRODUCTION_NAME,
|
||||
TOKEN_NAME,
|
||||
COLOR_PRODUCTION,
|
||||
COLOR_BACKGROUND,
|
||||
COLOR_FONT_MAIN,
|
||||
COLOR_FONT_SECONDARY,
|
||||
COLOR_TOP,
|
||||
SIZE_ICON_XS,
|
||||
SIZE_ICON_SM,
|
||||
SIZE_ICON_MD,
|
||||
SIZE_ICON_LG,
|
||||
SIZE_ICON_XL,
|
||||
SYSTEM_OK,
|
||||
SYSTEM_LOGIN_SUCCESS,
|
||||
SYSTEM_PASSWORD_CHANGE_SUCCESS,
|
||||
SYSTEM_LOGOUT_SUCCESS,
|
||||
SYSTEM_TOKEN_RENEW_SUCCESS,
|
||||
SYSTEM_UNAUTHORIZED,
|
||||
SYSTEM_USERNAME_NOT_FOUND,
|
||||
SYSTEM_ACCESS_DENIED,
|
||||
SYSTEM_USER_DISABLE,
|
||||
SYSTEM_LOGIN_USERNAME_PASSWORD_ERROR,
|
||||
SYSTEM_OLD_PASSWORD_NOT_MATCH,
|
||||
SYSTEM_LOGOUT_FAILED,
|
||||
SYSTEM_TOKEN_ILLEGAL,
|
||||
SYSTEM_TOKEN_HAS_EXPIRED,
|
||||
SYSTEM_REQUEST_ILLEGAL,
|
||||
SYSTEM_ARGUMENT_NOT_VALID,
|
||||
SYSTEM_ERROR,
|
||||
SYSTEM_TIMEOUT
|
||||
}
|
||||
35
src/constants/common.constants.ts
Normal file
35
src/constants/common.constants.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export const PRODUCTION_NAME = 'FatWeb'
|
||||
export const STORAGE_TOKEN_KEY = 'JWT_TOKEN'
|
||||
export const STORAGE_USER_INFO_KEY = 'USER_INFO'
|
||||
export const COLOR_PRODUCTION = '#00D4FF'
|
||||
export const COLOR_BACKGROUND = '#F5F5F5'
|
||||
export const COLOR_TOP = 'rgba(234,46,13,0.85)'
|
||||
export const COLOR_FONT_MAIN = '#4D4D4D'
|
||||
export const COLOR_FONT_SECONDARY = '#9E9E9E'
|
||||
export const SIZE_ICON_XS = '16px'
|
||||
export const SIZE_ICON_SM = '20px'
|
||||
export const SIZE_ICON_MD = '24px'
|
||||
export const SIZE_ICON_LG = '32px'
|
||||
export const SIZE_ICON_XL = '64px'
|
||||
|
||||
/**
|
||||
* Response code
|
||||
*/
|
||||
export const SYSTEM_OK = 10000
|
||||
export const SYSTEM_LOGIN_SUCCESS = 10020
|
||||
export const SYSTEM_PASSWORD_CHANGE_SUCCESS = 10021
|
||||
export const SYSTEM_LOGOUT_SUCCESS = 10022
|
||||
export const SYSTEM_TOKEN_RENEW_SUCCESS = 10023
|
||||
export const SYSTEM_UNAUTHORIZED = 10030
|
||||
export const SYSTEM_USERNAME_NOT_FOUND = 10031
|
||||
export const SYSTEM_ACCESS_DENIED = 10032
|
||||
export const SYSTEM_USER_DISABLE = 10033
|
||||
export const SYSTEM_LOGIN_USERNAME_PASSWORD_ERROR = 10034
|
||||
export const SYSTEM_OLD_PASSWORD_NOT_MATCH = 10035
|
||||
export const SYSTEM_LOGOUT_FAILED = 10036
|
||||
export const SYSTEM_TOKEN_ILLEGAL = 10037
|
||||
export const SYSTEM_TOKEN_HAS_EXPIRED = 10038
|
||||
export const SYSTEM_REQUEST_ILLEGAL = 10040
|
||||
export const SYSTEM_ARGUMENT_NOT_VALID = 10041
|
||||
export const SYSTEM_ERROR = 10050
|
||||
export const SYSTEM_TIMEOUT = 10051
|
||||
3
src/constants/urls.constants.ts
Normal file
3
src/constants/urls.constants.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const URL_API_LOGIN = '/login'
|
||||
export const URL_API_TOKEN = '/token'
|
||||
export const URL_API_LOGOUT = '/logout'
|
||||
Reference in New Issue
Block a user