12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import request from '@/config/axios'
- import type { UserType } from './types'
- interface RoleParams {
- roleName: string
- }
- export const loginApi = (data: UserType): Promise<IResponse<UserType>> => {
- return request.post({
- url: '/uc/oauth/token',
- data: Object.assign({}, data, {
- client_id: 'chelvc_client',
- client_secret: 'qWBe6jD%GCuPPTkP',
- grant_type: 'password'
- }),
- headersType: 'application/x-www-form-urlencoded',
- headers: {
- Platform: 'PC',
- Terminal: 'ADMIN'
- }
- })
- }
- export const loginOutApi = (): Promise<IResponse> => {
- return request.get({ url: '/user/loginOut' })
- }
- export const getUserListApi = ({ params }: AxiosConfig) => {
- return request.get<{
- code: string
- data: {
- list: UserType[]
- total: number
- }
- }>({ url: '/user/list', params })
- }
- export const getAdminRoleApi = (
- params: RoleParams
- ): Promise<IResponse<AppCustomRouteRecordRaw[]>> => {
- return request.get({ url: '/role/list', params })
- }
- export const getTestRoleApi = (params: RoleParams): Promise<IResponse<string[]>> => {
- return request.get({ url: '/role/list', params })
- }
|