mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-22 12:58:55 +08:00
♻️ Refactoring code. 优化 .env 适配 higress
This commit is contained in:
parent
e8481aa72f
commit
e91db1a432
11
.env
11
.env
@ -7,20 +7,17 @@ VITE_PUBLIC_PATH = /
|
||||
# 后端请求前缀
|
||||
VITE_API_URL = /api
|
||||
|
||||
# 前端加密密钥
|
||||
VITE_PWD_ENC_KEY='thanks,pig4cloud'
|
||||
|
||||
# OAUTH2 密码模式客户端信息
|
||||
VITE_OAUTH2_PASSWORD_CLIENT='pig:pig'
|
||||
|
||||
# OAUTH2 短信客户端信息
|
||||
VITE_OAUTH2_MOBILE_CLIENT='app:app'
|
||||
|
||||
# OAUTH2 社交登录客户端信息
|
||||
VITE_OAUTH2_SOCIAL_CLIENT='social:social'
|
||||
|
||||
# 是否开启前端验证码
|
||||
VITE_VERIFY_ENABLE = true
|
||||
VITE_VERIFY_ENABLE = false
|
||||
|
||||
# 前端加密密钥
|
||||
VITE_PWD_ENC_KEY='thanks,pig4cloud'
|
||||
|
||||
# 是否开启websocket 消息接受,
|
||||
VITE_WEBSOCKET_ENABLE = false
|
||||
|
@ -17,8 +17,11 @@ const FORM_CONTENT_TYPE = 'application/x-www-form-urlencoded';
|
||||
export const login = (data: any) => {
|
||||
const basicAuth = 'Basic ' + window.btoa(import.meta.env.VITE_OAUTH2_PASSWORD_CLIENT);
|
||||
Session.set('basicAuth', basicAuth);
|
||||
let encPassword = data.password;
|
||||
// 密码加密
|
||||
const encPassword = other.encryption(data.password, import.meta.env.VITE_PWD_ENC_KEY);
|
||||
if (import.meta.env.VITE_PWD_ENC_KEY) {
|
||||
encPassword = other.encryption(data.password, import.meta.env.VITE_PWD_ENC_KEY);
|
||||
}
|
||||
const {username, randomStr, code, grant_type, scope} = data;
|
||||
return request({
|
||||
url: '/auth/oauth2/token',
|
||||
|
Loading…
Reference in New Issue
Block a user