From 65c7175a1d7d448f91ee61a8a9aa935263939d37 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期四, 17 四月 2025 10:10:22 +0800 Subject: [PATCH] feat: 接口对接 --- src/services/api/User.ts | 155 +-------------------------------------------------- 1 files changed, 3 insertions(+), 152 deletions(-) diff --git a/src/services/api/User.ts b/src/services/api/User.ts index a1d348f..603e2e7 100644 --- a/src/services/api/User.ts +++ b/src/services/api/User.ts @@ -2,159 +2,10 @@ // @ts-ignore import { request } from '@/utils/request'; -/** 鏂板璐﹀彿淇℃伅 POST /api/User/CreateAccount */ -export async function createAccount(body: API.CreateAccountInput, options?: API.RequestConfig) { - return request<string>('/api/User/CreateAccount', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }); -} - -/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/User/CreateRole */ -export async function createRole(body: API.CreateOrUpdateRoleInput, options?: API.RequestConfig) { - return request<string>('/api/User/CreateRole', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }); -} - -/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/User/DeleteRole */ -export async function deleteRole( - // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄) - params: API.APIdeleteRoleParams, - options?: API.RequestConfig -) { - return request<number>('/api/User/DeleteRole', { - method: 'POST', - params: { - ...params, - }, - ...(options || {}), - }); -} - -/** 鑾峰彇鎵�鏈夎鑹� GET /api/User/GetAllRoles */ -export async function getAllRoles(options?: API.RequestConfig) { - return request<API.RoleInfo[]>('/api/User/GetAllRoles', { +/** 鑾峰彇涓汉淇℃伅璇︽儏 GET /api/User/GetUserInfo */ +export async function getUserInfo(options?: API.RequestConfig) { + return request<API.UserDto>('/api/User/GetUserInfo', { method: 'GET', - ...(options || {}), - }); -} - -/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/User/GetOssSTS */ -export async function getOssSTS(options?: API.RequestConfig) { - return request<API.OssSTSReponse>('/api/User/GetOssSTS', { - method: 'POST', - ...(options || {}), - }); -} - -/** 鑾峰彇瑙掕壊鍒嗛〉鍒楄〃 POST /api/User/GetRoles */ -export async function getRoles(body: API.GetRolesInput, options?: API.RequestConfig) { - return request<API.RoleInfoPageOutput>('/api/User/GetRoles', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }); -} - -/** 鑾峰彇token POST /api/User/GetTokenForWeb */ -export async function getTokenForWeb(body: API.AccessRequestDto, options?: API.RequestConfig) { - return request<API.IdentityModelTokenCacheItem>('/api/User/GetTokenForWeb', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }); -} - -/** 鑾峰彇鐢ㄦ埛璇︽儏 GET /api/User/GetUserDetail */ -export async function getUserDetail( - // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄) - params: API.APIgetUserDetailParams, - options?: API.RequestConfig -) { - return request<API.UserDetailOutput>('/api/User/GetUserDetail', { - method: 'GET', - params: { - ...params, - }, - ...(options || {}), - }); -} - -/** 鑾峰彇鐢ㄦ埛鍒嗛〉鍒楄〃 POST /api/User/GetUserPage */ -export async function getUserPage(body: API.QueryUserPageInput, options?: API.RequestConfig) { - return request<API.UserListOutputPageOutput>('/api/User/GetUserPage', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }); -} - -/** 瀵嗙爜鐧诲綍 POST /api/User/PasswordLogin */ -export async function passwordLogin(body: API.PasswordLoginInput, options?: API.RequestConfig) { - return request<API.IdentityModelTokenCacheItem>('/api/User/PasswordLogin', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }); -} - -/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/User/RoleEnableOrForbid */ -export async function roleEnableOrForbid( - body: API.RoleEnableOrForbidInput, - options?: API.RequestConfig -) { - return request<number>('/api/User/RoleEnableOrForbid', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }); -} - -/** 鏇存柊璐﹀彿淇℃伅 POST /api/User/UpdateAccount */ -export async function updateAccount(body: API.UpdateAccountInput, options?: API.RequestConfig) { - return request<number>('/api/User/UpdateAccount', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }); -} - -/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/User/UpdateRole */ -export async function updateRole(body: API.CreateOrUpdateRoleInput, options?: API.RequestConfig) { - return request<number>('/api/User/UpdateRole', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, ...(options || {}), }); } -- Gitblit v1.9.1