| | |
| | | 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, |
| | |
| | | password, |
| | | grant_type:"password", |
| | | scope: "all", |
| | | type, |
| | | // 查全部-暂定 |
| | | loginType:1 |
| | | type |
| | | } |
| | | }); |
| | | |
| | | 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, |
| | |
| | | refresh_token, |
| | | grant_type: "refresh_token", |
| | | scope: "all", |
| | | } |
| | | }); |
| | | |
| | | export const loginForm = (tenant_id, username, password,client_id,response_type,redirect_uri) => request({ |
| | | url: '/api/oauth/form', |
| | | method: 'post', |
| | | headers:{ |
| | | 'Content-Type':"application/x-www-form-urlencoded", |
| | | 'client_id':client_id, |
| | | 'response_type':response_type, |
| | | 'redirect_uri':redirect_uri |
| | | }, |
| | | params: { |
| | | tenant_id, |
| | | username, |
| | | password |
| | | } |
| | | }); |
| | | |
| | | export const loginTo = (tenantId, username, password,client_id,response_type,redirect_uri) => request({ |
| | | url: '/api/oauth/loginTo', |
| | | method: 'post', |
| | | headers:{ |
| | | 'Content-Type':"application/x-www-form-urlencoded", |
| | | 'client_id':client_id, |
| | | 'response_type':response_type, |
| | | 'redirect_uri':redirect_uri |
| | | }, |
| | | params: { |
| | | tenantId, |
| | | username, |
| | | password |
| | | } |
| | | }); |
| | | |
| | |
| | | }); |
| | | |
| | | export const logout = () => request({ |
| | | url: '/api/blade-auth/oauth/logout', |
| | | url: '/api/oauth/logout', |
| | | method: 'get', |
| | | authorization: false |
| | | }); |