feat(security): 添加密码加密功能
在用户登录时对密码进行加密处理,使用 Base64 编码和 RSA 加密增强安全性 新增 crypto.js 工具文件并添加相关依赖
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { getAction, postAction, deleteAction } from './manage.js';
|
||||
import url, { getBaseUrl } from './url.js';
|
||||
import { encryptPassword } from '@/utils/crypto.js';
|
||||
|
||||
// 健康检查
|
||||
export const getHealthAction = () => getAction(url.health);
|
||||
|
||||
// 用户登录
|
||||
export const loginAction = (data, sparkBaseUrl) => postAction(url.user.login, data, {}, sparkBaseUrl);
|
||||
export const loginAction = (data, sparkBaseUrl) =>
|
||||
postAction(url.user.login, { email: data.email, password: encryptPassword(data.password) }, {}, sparkBaseUrl);
|
||||
|
||||
// 会话
|
||||
export const createSessionAction = (data) => postAction(url.session.create, data);
|
||||
|
||||
Reference in New Issue
Block a user