提交 | 用户 | 时间
|
314507
|
1 |
import request from '@/config/axios' |
8e4ab7
|
2 |
import {Oauth2TokenVO, UserLoginVO} from './types' |
H |
3 |
import { config } from '@/config/axios/config' |
|
4 |
|
|
5 |
const { plat_url} = config |
314507
|
6 |
|
H |
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) => { |
8e4ab7
|
19 |
return request.post({ url: plat_url + '/system/auth/login', data }) |
H |
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 }) |
314507
|
27 |
} |
H |
28 |
|
|
29 |
// 使用租户名,获得租户编号 |
|
30 |
export const getTenantIdByName = (name: string) => { |
8e4ab7
|
31 |
return request.get({ url: plat_url + '/system/tenant/get-id-by-name?name=' + name }) |
314507
|
32 |
} |
H |
33 |
|
|
34 |
// 登出 |
|
35 |
export const loginOut = () => { |
8e4ab7
|
36 |
return request.post({ url: plat_url + '/system/auth/logout' }) |
314507
|
37 |
} |
H |
38 |
|
|
39 |
// 获取用户权限信息 |
|
40 |
export const getInfo = () => { |
8e4ab7
|
41 |
return request.get({ url: plat_url + '/system/auth/get-permission-info' }) |
314507
|
42 |
} |
H |
43 |
|
|
44 |
// 获取验证图片以及 token |
|
45 |
export const getCode = (data) => { |
8e4ab7
|
46 |
return request.postOriginal({ url: plat_url + '/system/captcha/get', data }) |
314507
|
47 |
} |
H |
48 |
|
|
49 |
// 滑动或者点选验证 |
|
50 |
export const reqCheck = (data) => { |
8e4ab7
|
51 |
return request.postOriginal({ url: plat_url + '/system/captcha/check', data }) |
314507
|
52 |
} |
H |
53 |
|