| | |
| | | import website from "@/config/website"; |
| | | |
| | | export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key, code) => request({ |
| | | url: '/api/blade-auth/oauth/token', |
| | | url: '/api/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Tenant-Id': tenantId, |
| | | 'Dept-Id': (website.switchMode ? deptId : ''), |
| | | 'Role-Id': (website.switchMode ? roleId : ''), |
| | | 'Captcha-Key': key, |
| | | 'Captcha-Code': code, |
| | | // 'Captcha-Key': key, |
| | | // 'Captcha-Code': code, |
| | | }, |
| | | params: { |
| | | tenantId, |
| | | username, |
| | | password, |
| | | grant_type: (website.captchaMode ? "captcha" : "password"), |
| | | grant_type:"password", |
| | | scope: "all", |
| | | type |
| | | } |
| | | }); |
| | | |
| | | export const loginForm = (tenant_id, username, password) => request({ |
| | | url: '/api/oauth/form', |
| | | method: 'post', |
| | | headers:{ |
| | | 'Content-Type':"application/x-www-form-urlencoded" |
| | | }, |
| | | params: { |
| | | tenant_id, |
| | | username, |
| | | password |
| | | } |
| | | }); |
| | | |
| | | export const loginBySocial = (tenantId, source, code, state) => request({ |
| | | url: '/api/blade-auth/oauth/token', |
| | | url: '/api/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Tenant-Id': tenantId |
| | |
| | | }) |
| | | |
| | | export const loginBySso = (state, code) => request({ |
| | | url: '/api/blade-auth/oauth/token', |
| | | url: '/api/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Tenant-Id': state |
| | |
| | | }) |
| | | |
| | | export const refreshToken = (refresh_token, tenantId, deptId, roleId) => request({ |
| | | url: '/api/blade-auth/oauth/token', |
| | | url: '/api/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Tenant-Id': tenantId, |
| | |
| | | }); |
| | | |
| | | export const registerGuest = (form, oauthId) => request({ |
| | | url: '/api/blade-system/user/register-guest', |
| | | url: '/api//user/register-guest', |
| | | method: 'post', |
| | | params: { |
| | | tenantId: form.tenantId, |
| | |
| | | }); |
| | | |
| | | export const getButtons = () => request({ |
| | | url: '/api/blade-system/menu/buttons', |
| | | url: '/api//menu/buttons', |
| | | method: 'get' |
| | | }); |
| | | |