feat: 添加钉钉扫码登录功能
Some checks failed
continuous-integration/drone/push Build is failing

- 后端:钉钉 OAuth 认证服务
- 后端:系统设置 API(钉钉配置)
- 前端:登录页钉钉扫码入口
- 前端:系统设置页面
- 数据库迁移脚本
This commit is contained in:
yuliang_guo
2026-01-29 14:40:00 +08:00
parent c5d460b413
commit 662947cd06
16 changed files with 1417 additions and 9 deletions

View File

@@ -102,3 +102,34 @@ export const getCurrentUser = (): Promise<ApiResponse<UserInfo>> => {
export const resetPasswordRequest = (email: string): Promise<ApiResponse<null>> => {
return request.post('/api/v1/auth/reset-password', { email })
}
// ============================================
// 钉钉免密登录 API
// ============================================
// 钉钉登录请求参数
export interface DingtalkLoginParams {
code: string
tenant_id?: number
}
// 钉钉配置响应
export interface DingtalkConfig {
enabled: boolean
corp_id: string | null
agent_id: string | null
}
/**
* 钉钉免密登录
*/
export const dingtalkLogin = (data: DingtalkLoginParams): Promise<ApiResponse<LoginResult>> => {
return request.post('/api/v1/auth/dingtalk/login', data)
}
/**
* 获取钉钉配置用于前端初始化JSDK
*/
export const getDingtalkConfig = (tenantId: number = 1): Promise<ApiResponse<DingtalkConfig>> => {
return request.get('/api/v1/auth/dingtalk/config', { params: { tenant_id: tenantId } })
}