mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
feat: 权限控制
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import { request, requestForMock } from "../service";
|
||||
import { env } from "/@/utils/util.env";
|
||||
|
||||
export interface RegisterReq {
|
||||
username: string;
|
||||
password: string;
|
||||
confirmPassword: string;
|
||||
}
|
||||
/**
|
||||
* @description: Login interface parameters
|
||||
*/
|
||||
@@ -19,6 +25,14 @@ export interface LoginRes {
|
||||
expire: number;
|
||||
}
|
||||
|
||||
export async function register(user: RegisterReq): Promise<UserInfoRes> {
|
||||
return await request({
|
||||
url: "/register",
|
||||
method: "post",
|
||||
data: user
|
||||
});
|
||||
}
|
||||
|
||||
export async function login(data: LoginReq): Promise<LoginRes> {
|
||||
if (env.PM_ENABLED === "false") {
|
||||
//没有开启权限模块,模拟登录
|
||||
|
||||
Reference in New Issue
Block a user