12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- import {httpApi} from "../request/httpApi";
- import website from "~src/config/index";
- import md5 from 'js-md5'
- export const userLogin = ({tenantId, deptId, roleId, username, password, type, key, code}, msg = true) => httpApi({
- url: '/api/blade-auth/oauth/token',
- method: 'post',
- headers: {
- 'Tenant-Id': tenantId,
- 'Dept-Id': (website.switchMode ? deptId : ''),
- 'Role-Id': (website.switchMode ? roleId : ''),
- 'Captcha-Key': key,
- 'Captcha-Code': code,
- },
- params: {
- tenantId,
- username,
- password: md5(password),
- grant_type: (website.captchaMode ? "captcha" : "password"),
- scope: "all",
- type
- }
- }, msg);
- export const refreshToken = (refresh_token, tenantId, deptId, roleId, msg = true) => httpApi({
- url: '/api/blade-auth/oauth/token',
- method: 'post',
- headers: {
- 'Tenant-Id': tenantId,
- 'Dept-Id': (website.switchMode ? deptId : ''),
- 'Role-Id': (website.switchMode ? roleId : '')
- },
- params: {
- tenantId,
- refresh_token,
- grant_type: "refresh_token",
- scope: "all",
- }
- }, msg);
- export const logout = (msg = true) => httpApi({
- url: '/api/blade-auth/oauth/logout',
- method: 'get'
- }, msg);
- export const registerGuest = (form, oauthId, msg = true) => httpApi({
- url: '/api/blade-user/register-guest',
- method: 'post',
- params: {
- tenantId: form.tenantId,
- name: form.name,
- account: form.account,
- password: form.password,
- oauthId
- }
- }, msg);
- export const getProjectAndContract = (msg = true) => httpApi({
- url: '/api/blade-business/userViewProjectContract/queryUserViewProjectAndContract',
- method: 'get'
- }, msg);
- export const getCaptcha = (msg = true) => httpApi({
- url: '/api/blade-auth/oauth/captcha',
- method: 'get'
- }, msg);
- export const getUserInfo = (msg = true) => httpApi({
- url: '/api/blade-auth/oauth/user-info',
- method: 'get'
- }, msg);
- export const sendLogs = (list, msg = true) => httpApi({
- url: '/api/blade-auth/oauth/logout',
- method: 'post',
- data: list
- }, msg);
- export const clearCache = (msg = true) => httpApi({
- url: '/api/blade-auth/oauth/clear-cache',
- method: 'get'
- }, msg);
- export const loginByToken = (form, msg = true) => httpApi({
- url: '/api/blade-user/loginByToken',
- method: 'post',
- params: form
- }, msg);
- //获取租户ID
- export const getTenantID = (domain, msg = true) => httpApi({
- url: '/api/blade-system/tenant/info',
- method: 'get',
- params: {
- domain
- }
- }, msg);
|