chore: initial commit

This commit is contained in:
2026-07-22 17:50:30 +08:00
parent d46cdd676e
commit 3abf272e33
190 changed files with 18073 additions and 0 deletions

35
src/api/system/user.ts Normal file
View File

@@ -0,0 +1,35 @@
import { http } from '@/lib'
import type { SysRole, SysUser, SysUserFormOutput, SysUserInfo } from '@/schemas'
import { type PageParams } from '@/schemas'
export const getSysUsers = (params: PageParams) => {
return http.get<SysUser[], ApiPageResponse<SysUser>>('/user', { params })
}
export const getSysUserRoles = (id: number) => {
return http.get<SysRole[]>(`/user/${id}/roles`)
}
export const getSysUserInfo = () => {
return http.get<SysUserInfo>('/user/info')
}
export const updateSysUser = (id: number, data: SysUserFormOutput) => {
return http.patch('/user/' + id, data)
}
export const createSysUser = (data: SysUserFormOutput) => {
return http.post('/user', data)
}
export const deleteSysUser = (id: number) => {
return http.delete(`/user/${id}`)
}
export const assignSysUserRoles = (id: number, role_ids: number[]) => {
return http.put(`user/${id}/roles`, { role_ids })
}
export const changeSysUserPassword = (id: number, password: string) => {
return http.patch(`/user/${id}/password`, { password })
}