chore: update app name
This commit is contained in:
2
apps/web-antd/src/apis/index.ts
Normal file
2
apps/web-antd/src/apis/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './modules';
|
||||
export type * from './types';
|
1
apps/web-antd/src/apis/modules/index.ts
Normal file
1
apps/web-antd/src/apis/modules/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './user';
|
22
apps/web-antd/src/apis/modules/user.ts
Normal file
22
apps/web-antd/src/apis/modules/user.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { UserApiType } from '@/apis/types';
|
||||
import type { UserInfo } from '@vben/types';
|
||||
|
||||
import { request } from '@/forward';
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
async function userLogin(data: UserApiType.LoginParams) {
|
||||
return request<UserApiType.LoginResult>('/login', { data, method: 'post' });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
async function getUserInfo() {
|
||||
return request<UserInfo>('/getUserInfo', { method: 'get' });
|
||||
}
|
||||
|
||||
export { getUserInfo, userLogin };
|
||||
|
||||
export * from './user';
|
1
apps/web-antd/src/apis/types/index.ts
Normal file
1
apps/web-antd/src/apis/types/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export type * from './user';
|
18
apps/web-antd/src/apis/types/user.ts
Normal file
18
apps/web-antd/src/apis/types/user.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace UserApiType {
|
||||
/** 登录接口参数 */
|
||||
export interface LoginParams {
|
||||
password: string;
|
||||
username: string;
|
||||
}
|
||||
|
||||
/** 登录接口返回值 */
|
||||
export interface LoginResult {
|
||||
accessToken: string;
|
||||
desc: string;
|
||||
realName: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
}
|
||||
}
|
||||
|
||||
export type { UserApiType };
|
Reference in New Issue
Block a user