| | |
| | | import { http } from '@/utils/http' |
| | | import type { LoginParams } from './login.d' |
| | | import type { LoginParams, UserInfoResp } from './login.d' |
| | | const clientId = import.meta.env.VITE_APP_CLIENT_ID |
| | | |
| | | const DEFAULT_TENANT_ID = '000000' |
| | | const GRANT_TYPE = 'password' |
| | | |
| | | /** GET 请求 */ |
| | | export const getFooAPI = (name: string) => { |
| | | return http.get<LoginParams>('/foo', { name }) |
| | | } |
| | | |
| | | /** POST 请求 */ |
| | | /** get 请求 */ |
| | | export const login = (params: LoginParams) => { |
| | | const { username, password } = params |
| | | // 构造新的请求参数,避免直接修改原始对象 |
| | |
| | | } |
| | | return http.post<any>('/auth/login', requestData) |
| | | } |
| | | |
| | | export const getUserInfo = () => { |
| | | return http.get<null | UserInfoResp>('/system/user/getInfo') |
| | | } |