105 lines
1.9 KiB
JavaScript
Raw Normal View History

import request from '@/utils/request'
// 登录方法
export function login(username, password, code, uuid) {
const data = {
username,
password,
code,
uuid
}
return request({
2022-04-26 23:36:26 +08:00
url: '/system/auth/login',
method: 'post',
data: data
})
}
// 获取用户详细信息
export function getInfo() {
return request({
2022-04-26 23:36:26 +08:00
url: '/system/auth/get-permission-info',
method: 'get'
})
}
// 退出方法
export function logout() {
return request({
url: '/system/logout',
method: 'post'
})
}
// 获取验证码
export function getCodeImg() {
return request({
url: '/system/captcha/get-image',
method: 'get',
timeout: 20000
})
}
// 社交授权的跳转
export function socialAuthRedirect(type, redirectUri) {
return request({
2022-04-26 23:36:26 +08:00
url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri,
method: 'get'
})
}
2022-04-26 23:36:26 +08:00
// 社交快捷登录,使用 code 授权码
export function socialQuickLogin(type, code, state) {
return request({
2022-04-26 23:36:26 +08:00
url: '/system/auth/social-quick-login',
method: 'post',
data: {
type,
code,
state
}
})
}
2021-10-02 23:55:41 +08:00
2022-04-26 23:36:26 +08:00
// 社交绑定登录,使用 code 授权码 + + 账号密码
export function socialBindLogin(type, code, state, username, password) {
2021-10-02 23:55:41 +08:00
return request({
2022-04-26 23:36:26 +08:00
url: '/system/auth/social-bind-login',
2021-10-02 23:55:41 +08:00
method: 'post',
data: {
type,
code,
state,
username,
password
}
})
}
// 获取登录验证码
export function sendLoginSmsCode(mobile,scene,uuid,code) {
var datas = {
mobile
,scene
,uuid,
code
};
return request({
url: '/system/send-login-sms-code',
method: 'post',
data: datas
})
}
// 短信验证码登录
export function smsLogin(mobile, code) {
return request({
url: '/system/sms-login',
method: 'post',
data: {
mobile,
code
}
})
}