This commit is contained in:
azizziy
2025-05-20 17:02:10 +05:00
commit c01e852a59
257 changed files with 27766 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
export type UserRole = 'ADMIN' | 'CHINA_WORKER';
export enum UserRoleEnum {
ADMIN = 'ADMIN',
CHINA_WORKER = 'CHINA_WORKER',
UZB_WORKER = 'UZB_WORKER',
}
export type User = {
id: number;
username: string;
fullName?: string;
phone?: string;
address?: string;
role: UserRoleEnum;
active: boolean;
};

View File

@@ -0,0 +1,19 @@
import { User } from '@/data/user/user.model';
import { CommonResponseType } from '@/helpers/types';
import { request } from '@/services/request';
export const user_requests = {
async getMe() {
return request.get<CommonResponseType<User>>('/users/info');
},
async login(body: { username: string; password: string }) {
return request.post<
CommonResponseType<{
username: string;
accessToken: string;
roles: string[];
}>
>('/auth/token', body);
},
};

View File