This commit is contained in:
dzc committed 2025-10-17 13:01:55 +08:00
commit 5485c3b85a
94 files changed
+10131

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
import { service } from "./share/request"
/**
* 获取个人信息
*/
export const getUserInfo = (params) => {
return service({
url: '/admin/user/info',
method: 'get',
params,
})
}
/**
* 刷新token
*/
export const refreshToken = (refresh_token) => {
const basicAuth = 'Basic ' + window.btoa('pig:pig');
const grant_type = 'refresh_token';
const scope = 'server';
return service({
url: '/auth/oauth2/token',
method: 'post',
headers: {
skipToken: true,
Authorization: basicAuth,
'Content-Type': "application/x-www-form-urlencoded",
},
params: { refresh_token, grant_type, scope },
})
}
export const checkToken = (token) => {
const basicAuth = 'Basic ' + window.btoa('pig:pig');
return service({
url: '/auth/token/check_token',
method: 'get',
headers: {
skipToken: true,
Authorization: basicAuth,
'Content-Type': 'application/x-www-form-urlencoded',
},
params: { token },
})
}