| File was renamed from src/api/user.js |
| | |
| | | import website from "@/config/website"; |
| | | |
| | | export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key, code) => request({ |
| | | url: '/api/oauth/token', |
| | | url: '/ssoapi/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Tenant-Id': tenantId, |
| | |
| | | }); |
| | | |
| | | export const loginBySocial = (tenantId, source, code, state) => request({ |
| | | url: '/api/oauth/token', |
| | | url: '/ssoapi/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Tenant-Id': tenantId |
| | |
| | | }) |
| | | |
| | | export const loginBySso = (state, code) => request({ |
| | | url: '/api/oauth/token', |
| | | url: '/ssoapi/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Tenant-Id': state |
| | |
| | | }) |
| | | |
| | | export const refreshToken = (refresh_token, tenantId, deptId, roleId) => request({ |
| | | url: '/api/oauth/token', |
| | | url: '/ssoapi/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Tenant-Id': tenantId, |
| | |
| | | }); |
| | | |
| | | export const loginForm = (tenant_id, username, password,client_id,response_type,redirect_uri) => request({ |
| | | url: '/api/oauth/form', |
| | | url: '/ssoapi/oauth/form', |
| | | method: 'post', |
| | | headers:{ |
| | | 'Content-Type':"application/x-www-form-urlencoded", |
| | |
| | | }); |
| | | |
| | | export const loginTo = (tenantId, username, password,client_id,response_type,redirect_uri) => request({ |
| | | url: '/api/oauth/loginTo', |
| | | url: '/ssoapi/oauth/loginTo', |
| | | method: 'post', |
| | | headers:{ |
| | | 'Content-Type':"application/x-www-form-urlencoded", |
| | |
| | | }); |
| | | |
| | | export const registerGuest = (form, oauthId) => request({ |
| | | url: '/api/blade-system/user/register-guest', |
| | | url: '/ssoapi/blade-system/user/register-guest', |
| | | method: 'post', |
| | | params: { |
| | | tenantId: form.tenantId, |
| | |
| | | }); |
| | | |
| | | export const getButtons = () => request({ |
| | | url: '/api/blade-system/menu/buttons', |
| | | url: '/ssoapi/blade-system/menu/buttons', |
| | | method: 'get' |
| | | }); |
| | | |
| | | export const getCaptcha = () => request({ |
| | | url: '/api/blade-auth/oauth/captcha', |
| | | url: '/ssoapi/blade-auth/oauth/captcha', |
| | | method: 'get', |
| | | authorization: false |
| | | }); |
| | | |
| | | export const logout = () => request({ |
| | | url: '/api/oauth/logout', |
| | | url: '/ssoapi/oauth/logout', |
| | | method: 'get', |
| | | authorization: false |
| | | }); |
| | | |
| | | export const getUserInfo = () => request({ |
| | | url: '/api/blade-auth/oauth/user-info', |
| | | url: '/ssoapi/blade-auth/oauth/user-info', |
| | | method: 'get' |
| | | }); |
| | | |
| | | export const sendLogs = (list) => request({ |
| | | url: '/api/blade-auth/oauth/logout', |
| | | url: '/ssoapi/blade-auth/oauth/logout', |
| | | method: 'post', |
| | | data: list |
| | | }); |
| | | |
| | | export const clearCache = () => request({ |
| | | url: '/api/blade-auth/oauth/clear-cache', |
| | | url: '/ssoapi/blade-auth/oauth/clear-cache', |
| | | method: 'get', |
| | | authorization: false |
| | | }); |