init
This commit is contained in:
commit
5485c3b85a
94 files changed
+10131
No files matched your search
@@ -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 },
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user