mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 11:05:06 +08:00
Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/1.8.0-uniapp
Conflicts: yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java yudao-ui-admin/src/components/ImageUpload/index.vue
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
import {getRefreshToken} from "@/utils/auth";
|
||||
import service from "@/utils/request";
|
||||
|
||||
// 登录方法
|
||||
export function login(username, password, code, uuid) {
|
||||
@ -26,7 +28,7 @@ export function getInfo() {
|
||||
// 退出方法
|
||||
export function logout() {
|
||||
return request({
|
||||
url: '/system/logout',
|
||||
url: '/system/auth/logout',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@ -99,3 +101,48 @@ export function smsLogin(mobile, code) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新访问令牌
|
||||
export function refreshToken() {
|
||||
return service({
|
||||
url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken(),
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// ========== OAUTH 2.0 相关 ==========
|
||||
|
||||
export function getAuthorize(clientId) {
|
||||
return request({
|
||||
url: '/system/oauth2/authorize?clientId=' + clientId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function authorize(responseType, clientId, redirectUri, state,
|
||||
autoApprove, checkedScopes, uncheckedScopes) {
|
||||
// 构建 scopes
|
||||
const scopes = {};
|
||||
for (const scope of checkedScopes) {
|
||||
scopes[scope] = true;
|
||||
}
|
||||
for (const scope of uncheckedScopes) {
|
||||
scopes[scope] = false;
|
||||
}
|
||||
// 发起请求
|
||||
return service({
|
||||
url: '/system/oauth2/authorize',
|
||||
headers:{
|
||||
'Content-type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
params: {
|
||||
response_type: responseType,
|
||||
client_id: clientId,
|
||||
redirect_uri: redirectUri,
|
||||
state: state,
|
||||
auto_approve: autoApprove,
|
||||
scope: JSON.stringify(scopes)
|
||||
},
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
44
yudao-ui-admin/src/api/system/oauth2/oauth2Client.js
Executable file
44
yudao-ui-admin/src/api/system/oauth2/oauth2Client.js
Executable file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建 OAuth2 客户端
|
||||
export function createOAuth2Client(data) {
|
||||
return request({
|
||||
url: '/system/oauth2-client/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新 OAuth2 客户端
|
||||
export function updateOAuth2Client(data) {
|
||||
return request({
|
||||
url: '/system/oauth2-client/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除 OAuth2 客户端
|
||||
export function deleteOAuth2Client(id) {
|
||||
return request({
|
||||
url: '/system/oauth2-client/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得 OAuth2 客户端
|
||||
export function getOAuth2Client(id) {
|
||||
return request({
|
||||
url: '/system/oauth2-client/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得 OAuth2 客户端分页
|
||||
export function getOAuth2ClientPage(query) {
|
||||
return request({
|
||||
url: '/system/oauth2-client/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
18
yudao-ui-admin/src/api/system/oauth2/oauth2Token.js
Normal file
18
yudao-ui-admin/src/api/system/oauth2/oauth2Token.js
Normal file
@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得访问令牌分页
|
||||
export function getAccessTokenPage(query) {
|
||||
return request({
|
||||
url: '/system/oauth2-token/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除访问令牌
|
||||
export function deleteAccessToken(accessToken) {
|
||||
return request({
|
||||
url: '/system/oauth2-token/delete?accessToken=' + accessToken,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询在线用户列表
|
||||
export function list(query) {
|
||||
return request({
|
||||
url: '/system/user-session/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 强退用户
|
||||
export function forceLogout(tokenId) {
|
||||
return request({
|
||||
url: '/system/user-session/delete?id=' + tokenId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user