mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-23 14:46:18 +08:00
chore: update types
This commit is contained in:
2
apps/antd-view/src/apis/index.ts
Normal file
2
apps/antd-view/src/apis/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './modules';
|
||||
export type * from './types';
|
1
apps/antd-view/src/apis/modules/index.ts
Normal file
1
apps/antd-view/src/apis/modules/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './user';
|
22
apps/antd-view/src/apis/modules/user.ts
Normal file
22
apps/antd-view/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 '@/apis/request';
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
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/antd-view/src/apis/types/index.ts
Normal file
1
apps/antd-view/src/apis/types/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export type * from './user';
|
@@ -1,4 +1,4 @@
|
||||
namespace UserApi {
|
||||
namespace UserApiType {
|
||||
/** 登录接口参数 */
|
||||
export interface LoginParams {
|
||||
password: string;
|
||||
@@ -15,4 +15,4 @@ namespace UserApi {
|
||||
}
|
||||
}
|
||||
|
||||
export type { UserApi };
|
||||
export type { UserApiType };
|
@@ -1 +0,0 @@
|
||||
export * from './modules/user';
|
@@ -1,23 +0,0 @@
|
||||
import type { UserInfo } from '@vben/types';
|
||||
|
||||
import { request } from '@/services/request';
|
||||
|
||||
import type { UserApi } from './typing';
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
async function userLogin(data: UserApi.LoginParams) {
|
||||
return request<UserApi.LoginResult>('/login', { data, method: 'post' });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
async function getUserInfo() {
|
||||
return request<UserInfo>('/getUserInfo', { method: 'get' });
|
||||
}
|
||||
|
||||
export { getUserInfo, userLogin };
|
||||
|
||||
export type { UserApi } from './typing';
|
@@ -3,7 +3,7 @@ import type { LoginAndRegisterParams } from '@vben/common-ui';
|
||||
|
||||
import { useAccessStore } from '@vben-core/stores';
|
||||
|
||||
import { getUserInfo, userLogin } from '@/services';
|
||||
import { getUserInfo, userLogin } from '@/apis';
|
||||
import { AuthenticationLogin } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { useRequest } from '@vben/request';
|
||||
|
Reference in New Issue
Block a user