From f2d1ba83bda8534465babf2a0a891a881bb181a5 Mon Sep 17 00:00:00 2001 From: xianyi Date: Tue, 16 Dec 2025 11:08:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=99=BB=E5=BD=95=EF=BC=88?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95-?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=AA=8C=E8=AF=81=E7=A0=81=EF=BC=89=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/his.ts | 14 ++++++++++++++ src/api/types.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/api/his.ts b/src/api/his.ts index ccf7724..7bd3e7f 100644 --- a/src/api/his.ts +++ b/src/api/his.ts @@ -34,6 +34,8 @@ import type { OperatorRemarkInfoAddResponse, InputVerificationCodeImage, VerificationCodeImageResponse, + InputLoginByPassword, + LoginByPasswordResponse, } from './types'; /** @@ -277,3 +279,15 @@ export const getVerificationCodeImage = ( ).then(res => res.data); }; +/** + * 登录(账号密码登录-图片验证码) + */ +export const loginByPassword = ( + data: InputLoginByPassword +): Promise => { + return request.post( + `/api/auth/login-by-password`, + data + ).then(res => res.data); +}; + diff --git a/src/api/types.ts b/src/api/types.ts index 738cc41..7647b1d 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -553,3 +553,38 @@ export interface OutputVerificationCodeImage { */ export type VerificationCodeImageResponse = CommonActionResult; +/** + * 登录(账号密码登录-图片验证码)入参 + */ +export interface InputLoginByPassword { + /** 登录账号 */ + username: string; + /** 登录密码 */ + password: string; + /** 图片验证码内容 */ + verification_code: string; + /** 图片验证码 key */ + verification_code_key: string; +} + +/** + * 登录(账号密码登录-图片验证码)出参 + */ +export interface OutputLoginByPassword { + /** 用户ID */ + user_id: string; + /** 用户姓名 */ + user_name: string; + /** 角色集合(逗号分隔) */ + roles: string; + /** 访问令牌 */ + access_token: string; + /** 刷新令牌 */ + refresh_token: string; +} + +/** + * 登录(账号密码登录-图片验证码)响应 + */ +export type LoginByPasswordResponse = CommonActionResult; +