import request from '@/config/axios'
|
import {Oauth2TokenVO, UserLoginVO} from './types'
|
import { config } from '@/config/axios/config'
|
|
const { plat_url} = config
|
|
export interface SmsCodeVO {
|
mobile: string
|
scene: number
|
}
|
|
export interface SmsLoginVO {
|
mobile: string
|
code: string
|
}
|
|
// 登录
|
export const login = (data: UserLoginVO) => {
|
return request.post({ url: plat_url + '/system/auth/login', data })
|
}
|
|
// 密码授权登录
|
export const oauth2Login = (data: Oauth2TokenVO) => {
|
return request.post({ url: plat_url + '/system/oauth2/token?' // 客户端
|
+ "client_id=" + data.clientId
|
+ "&client_secret=" + data.clientSecret, data })
|
}
|
|
// 使用租户名,获得租户编号
|
export const getTenantIdByName = (name: string) => {
|
return request.get({ url: plat_url + '/system/tenant/get-id-by-name?name=' + name })
|
}
|
|
// 登出
|
export const loginOut = () => {
|
return request.post({ url: plat_url + '/system/auth/logout' })
|
}
|
|
// 获取用户权限信息
|
export const getInfo = () => {
|
return request.get({ url: plat_url + '/system/auth/get-permission-info' })
|
}
|
|
// 获取应用菜单信息
|
export const getAppInfo = () => {
|
return request.get({ url: plat_url + '/system/auth/get-app-permission-info' })
|
}
|
|
// 获取验证图片以及 token
|
export const getCode = (data) => {
|
return request.postOriginal({ url: plat_url + '/system/captcha/get', data })
|
}
|
|
// 滑动或者点选验证
|
export const reqCheck = (data) => {
|
return request.postOriginal({ url: plat_url + '/system/captcha/check', data })
|
}
|