提交 | 用户 | 时间
|
37b204
|
1 |
import request from '@/config/axios' |
H |
2 |
import {Oauth2TokenVO, UserLoginVO} from './types' |
|
3 |
import { config } from '@/config/axios/config' |
|
4 |
|
|
5 |
const { plat_url} = config |
|
6 |
|
|
7 |
export interface SmsCodeVO { |
|
8 |
mobile: string |
|
9 |
scene: number |
|
10 |
} |
|
11 |
|
|
12 |
export interface SmsLoginVO { |
|
13 |
mobile: string |
|
14 |
code: string |
|
15 |
} |
|
16 |
|
|
17 |
// 登录 |
|
18 |
export const login = (data: UserLoginVO) => { |
|
19 |
return request.post({ url: plat_url + '/system/auth/login', data }) |
|
20 |
} |
|
21 |
|
|
22 |
// 密码授权登录 |
|
23 |
export const oauth2Login = (data: Oauth2TokenVO) => { |
|
24 |
return request.post({ url: plat_url + '/system/oauth2/token?' // 客户端 |
|
25 |
+ "client_id=" + data.clientId |
|
26 |
+ "&client_secret=" + data.clientSecret, data }) |
|
27 |
} |
|
28 |
|
|
29 |
// 使用租户名,获得租户编号 |
|
30 |
export const getTenantIdByName = (name: string) => { |
|
31 |
return request.get({ url: plat_url + '/system/tenant/get-id-by-name?name=' + name }) |
|
32 |
} |
|
33 |
|
|
34 |
// 登出 |
|
35 |
export const loginOut = () => { |
|
36 |
return request.post({ url: plat_url + '/system/auth/logout' }) |
|
37 |
} |
|
38 |
|
|
39 |
// 获取用户权限信息 |
|
40 |
export const getInfo = () => { |
|
41 |
return request.get({ url: plat_url + '/system/auth/get-permission-info' }) |
|
42 |
} |
|
43 |
|
91f388
|
44 |
// 获取应用菜单信息 |
H |
45 |
export const getAppInfo = () => { |
|
46 |
return request.get({ url: plat_url + '/system/auth/get-app-permission-info' }) |
|
47 |
} |
|
48 |
|
37b204
|
49 |
// 获取验证图片以及 token |
H |
50 |
export const getCode = (data) => { |
|
51 |
return request.postOriginal({ url: plat_url + '/system/captcha/get', data }) |
|
52 |
} |
|
53 |
|
|
54 |
// 滑动或者点选验证 |
|
55 |
export const reqCheck = (data) => { |
|
56 |
return request.postOriginal({ url: plat_url + '/system/captcha/check', data }) |
|
57 |
} |
|
58 |
|