/* eslint-disable */ // import request from '@/router/axios'; import website from "@/config/website"; import request from '@/utils/request'; const pjson = require('@/global.json'); const coderapi = pjson.coderapi export const loginByUsername = (tenantId: any, username: any, password: any, type: any, key: any, code: any) => request({ url: '/'+coderapi+'/coder-auth/oauth/token', method: 'post', headers: { 'Tenant-Id': tenantId, 'Captcha-Key': key, 'Captcha-Code': code, }, params: { tenantId, username, password, grant_type: (website.captchaMode ? "captcha" : "password"), scope: "all", type } }); export const loginByLdap = (tenantId: any, username: any, password: any, type: any, key: any, code: any) => request({ url: '/'+coderapi+'/coder-auth/oauth/token', method: 'post', headers: { 'Tenant-Id': tenantId, 'Captcha-Key': key, 'Captcha-Code': code, }, params: { tenantId, username, password, grant_type: "ldap", scope: "all", type } }); export const loginBySocial = (tenantId: any, source: any, code: any, state: any) => request({ url: '/'+coderapi+'/coder-auth/oauth/token', method: 'post', headers: { 'Tenant-Id': tenantId }, params: { tenantId, source, code, state, grant_type: "social", scope: "all", } }) export const loginByCas = (tenantId: any, ticket: any) => request({ url: '/'+coderapi+'/coder-auth/oauth/token', method: 'post', headers: { 'Tenant-Id': tenantId }, params: { tenantId, ticket, grant_type: "cas_ticket" } }) export const getCasProp = () => request({ url: '/'+coderapi+'/coder-auth/oauth/casProp', method: 'get' }) export const refreshToken = (refresh_token: any, tenantId: any) => request({ url: '/'+coderapi+'/coder-auth/oauth/token', method: 'post', headers: { 'Tenant-Id': tenantId }, params: { tenantId, refresh_token, grant_type: "refresh_token", scope: "all", } }); export const registerGuest = (form: any, oauthId: any) => request({ url: '/'+coderapi+'/coder-user/register-guest', method: 'post', params: { tenantId: form.tenantId, name: form.name, account: form.account, password: form.password, oauthId } }); export const getButtons = () => request({ url: '/'+coderapi+'/coder-system/menu/buttons', method: 'get' }); export const getCaptcha = () => request({ url: '/'+coderapi+'/coder-auth/oauth/captcha', method: 'get' }); export const logout = () => request({ url: '/'+coderapi+'/coder-auth/oauth/logout', method: 'get' }); export const getUserInfo = () => request({ url: '/'+coderapi+'/coder-auth/oauth/user-info', method: 'get' }); export const sendLogs = (list: any) => request({ url: '/'+coderapi+'/coder-auth/oauth/logout', method: 'post', data: list }); export const clearCache = () => request({ url: '/'+coderapi+'/coder-auth/oauth/clear-cache', method: 'get' });