修改部分规则模块删除无用前端 新增前端界面
This commit is contained in:
27
modeler/src/api/user.ts
Normal file
27
modeler/src/api/user.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* This file is part of the kernelstudio package.
|
||||
*
|
||||
* (c) 2014-2025 zlin <admin@kernelstudio.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE file
|
||||
* that was distributed with this source code.
|
||||
*/
|
||||
|
||||
import request, { HttpRequestClient } from '@/utils/request';
|
||||
import type { BasicResponse, UserLoginForm, UserLoginResult, UserSessionResult } from '@/types';
|
||||
|
||||
const req = new HttpRequestClient(HttpRequestClient.build({
|
||||
baseURL: '/',
|
||||
}));
|
||||
|
||||
export const fetchUserSession = (): Promise<UserSessionResult> => {
|
||||
return req.get<UserSessionResult>('/getInfo');
|
||||
};
|
||||
|
||||
export const signinByForm = (form: UserLoginForm): Promise<UserLoginResult> => {
|
||||
return req.postJson<UserLoginResult>('/login', form);
|
||||
};
|
||||
|
||||
export const logoutSession = (): Promise<BasicResponse> => {
|
||||
return request.post<BasicResponse>('/logout');
|
||||
};
|
||||
Reference in New Issue
Block a user