Files
glkvm-cloud/ui/src/api/user.ts
T
Jon Agramonte 5e16e10e9a feat: add optional LDAP authentication support
- Introduced LDAP authentication configuration options in the README and Docker Compose files.
- Updated API to handle dual authentication methods (LDAP and legacy).
- Implemented LDAP authentication logic in a new ldap.go file.
- Enhanced user login flow to support username and password for LDAP.
- Added error handling for authorization and authentication failures.
- Updated UI to include username input when LDAP is enabled and provide authentication options.
- Added localization for new authentication messages in English and Chinese.
2025-09-29 09:59:14 -04:00

41 lines
834 B
TypeScript

/*
* @Author: LPY
* @Date: 2025-06-03 12:21:21
* @LastEditors: CU-Jon
* @LastEditTime: 2025-09-26 14:02:57 EDT
* @FilePath: \glkvm-cloud\web-ui\src\api\user.ts
* @Description: 用户相关请求api
*/
import request from './request'
import type { LoginParams, AuthConfig } from '@/models/user'
/** 登录 */
export function reqLogin (data: LoginParams) {
return request<void>({
url: '/signin',
method: 'POST',
data,
})
}
/** 退出登录 */
export function reqLogout () {
return request<void>({
url: '/signout',
})
}
/** 判断登录状态 */
export function reqCheckLoginStatus () {
return request<void>({
url: '/alive',
})
}
/** 获取认证配置 */
export function reqAuthConfig () {
return request<AuthConfig>({
url: '/auth-config',
})
}