| | |
| | | import request from '@/axios'; |
| | | import request from '@/axios' |
| | | |
| | | import website from '@/config/website'; |
| | | import func from '@/utils/func'; |
| | | import website from '@/config/website' |
| | | import func from '@/utils/func' |
| | | |
| | | export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key, code) => |
| | | request({ |
| | |
| | | scope: 'all', |
| | | type, |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | export const loginBySocial = (tenantId, source, code, state) => |
| | | request({ |
| | |
| | | grant_type: 'social', |
| | | scope: 'all', |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | export const loginBySso = (state, code) => |
| | | request({ |
| | |
| | | scope: 'all', |
| | | redirect_uri: website.oauth2.redirectUri, |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | export const loginByPhone = (tenantId, phone, id, value) => |
| | | request({ |
| | |
| | | grant_type: 'sms_code', |
| | | scope: 'all', |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | export const refreshToken = (refresh_token, tenantId, deptId, roleId) => |
| | | request({ |
| | |
| | | grant_type: 'refresh_token', |
| | | scope: 'all', |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | export const registerUser = (tenantId, name, account, password, phone, email) => |
| | | request({ |
| | |
| | | grant_type: 'register', |
| | | scope: 'all', |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | export const registerGuest = (form, oauthId) => |
| | | request({ |
| | |
| | | password: form.password, |
| | | oauthId, |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | export const getButtons = () => |
| | | request({ |
| | | url: '/blade-system/menu/buttons', |
| | | method: 'get', |
| | | }); |
| | | }) |
| | | |
| | | export const getCaptcha = () => |
| | | request({ |
| | | url: '/blade-auth/oauth/captcha', |
| | | method: 'get', |
| | | authorization: false, |
| | | }); |
| | | }) |
| | | |
| | | export const logout = () => |
| | | request({ |
| | | url: '/blade-auth/oauth/logout', |
| | | method: 'get', |
| | | authorization: false, |
| | | }); |
| | | }) |
| | | |
| | | export const getUserInfo = () => |
| | | request({ |
| | | url: '/blade-auth/oauth/user-info', |
| | | method: 'get', |
| | | }); |
| | | }) |
| | | |
| | | export const sendLogs = list => |
| | | request({ |
| | | url: '/blade-auth/oauth/logout', |
| | | method: 'post', |
| | | data: list, |
| | | }); |
| | | }) |
| | | |
| | | export const clearCache = () => |
| | | request({ |
| | | url: '/blade-auth/oauth/clear-cache', |
| | | method: 'get', |
| | | authorization: false, |
| | | }); |
| | | }) |
| | | |
| | | export const sendSms = (tenantId, phone) => |
| | | request({ |
| | |
| | | tenantId, |
| | | phone, |
| | | }, |
| | | }); |
| | | }) |