vue2 新增行为验证码

This commit is contained in:
xingyu
2022-08-02 16:29:45 +08:00
parent ffa2850a22
commit 4a92081937
77 changed files with 1500 additions and 457 deletions

View File

@ -1,17 +1,16 @@
import request from '@/utils/request'
import {getRefreshToken} from "@/utils/auth";
import service from "@/utils/request";
import { getRefreshToken } from '@/utils/auth'
import service from '@/utils/request'
// 登录方法
export function login(username, password, code, uuid,
socialType, socialCode, socialState) {
export function login(username, password, socialType, socialCode, socialState) {
const data = {
username,
password,
code,
uuid,
// 社交相关
socialType, socialCode, socialState
socialType,
socialCode,
socialState
}
return request({
url: '/system/auth/login',
@ -36,15 +35,6 @@ export function logout() {
})
}
// 获取验证码
export function getCodeImg() {
return request({
url: '/system/captcha/get-image',
method: 'get',
timeout: 20000
})
}
// 社交授权的跳转
export function socialAuthRedirect(type, redirectUri) {
return request({
@ -108,20 +98,20 @@ export function getAuthorize(clientId) {
}
export function authorize(responseType, clientId, redirectUri, state,
autoApprove, checkedScopes, uncheckedScopes) {
autoApprove, checkedScopes, uncheckedScopes) {
// 构建 scopes
const scopes = {};
const scopes = {}
for (const scope of checkedScopes) {
scopes[scope] = true;
scopes[scope] = true
}
for (const scope of uncheckedScopes) {
scopes[scope] = false;
scopes[scope] = false
}
// 发起请求
return service({
url: '/system/oauth2/authorize',
headers:{
'Content-type': 'application/x-www-form-urlencoded',
headers: {
'Content-type': 'application/x-www-form-urlencoded'
},
params: {
response_type: responseType,