车间能级提升-智能设备管理系统
zhuguifei
2025-04-18 7db4e38c6d967d511f0c1248bf22ceaf6a6f55d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { http } from '@/utils/http'
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 login = (params: LoginParams) => {
  const { username, password } = params
  // 构造新的请求参数,避免直接修改原始对象
  const requestData = {
    username,
    password,
    clientId,
    tenantId: DEFAULT_TENANT_ID,
    grantType: GRANT_TYPE,
  }
  return http.post<any>('/auth/login', requestData)
}
 
export const getUserInfo = () => {
  return http.get<null | UserInfoResp>('/system/user/getInfo')
}