11
This commit is contained in:
69
api/user.js
Normal file
69
api/user.js
Normal file
@@ -0,0 +1,69 @@
|
||||
import {
|
||||
request
|
||||
} from '@/untils/AxiosUtils.js';
|
||||
import {
|
||||
getStore
|
||||
} from '@/untils/store.js'
|
||||
import website from "@/config/website";
|
||||
|
||||
export const loginByUsername = (tenantId, username, password, type, key, code) => request({
|
||||
url: '/api/jobslink-auth/oauth/token',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Login-Type': 'Type-U',
|
||||
'Captcha-Key': key,
|
||||
'Captcha-Code': code,
|
||||
'Platform-Id': getStore({
|
||||
name: 'platformId'
|
||||
}) || ''
|
||||
},
|
||||
params: {
|
||||
tenantId,
|
||||
username,
|
||||
password,
|
||||
grant_type: (website.captchaMode ? "captcha" : "password"),
|
||||
scope: "all",
|
||||
type
|
||||
}
|
||||
});
|
||||
|
||||
export const refreshToken = (refresh_token, tenantId) => request({
|
||||
url: '/api/jobslink-auth/oauth/token',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Tenant-Id': tenantId,
|
||||
'Login-Type': 'Type-U',
|
||||
},
|
||||
params: {
|
||||
tenantId,
|
||||
refresh_token,
|
||||
grant_type: "refresh_token",
|
||||
scope: "all",
|
||||
}
|
||||
});
|
||||
|
||||
export const getCaptcha = () => request({
|
||||
url: '/api/jobslink-auth/oauth/captcha',
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
export const logout = () => request({
|
||||
url: '/api/jobslink-auth/oauth/logout',
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
export const getUserInfo = () => request({
|
||||
url: '/api/jobslink-auth/oauth/user-info',
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
export const sendLogs = (list) => request({
|
||||
url: '/api/jobslink-auth/oauth/logout',
|
||||
method: 'post',
|
||||
data: list
|
||||
});
|
||||
|
||||
export const clearCache = () => request({
|
||||
url: '/api/jobslink-auth/oauth/clear-cache',
|
||||
method: 'get'
|
||||
});
|
||||
Reference in New Issue
Block a user