/* * @Author: shuishen 1109946754@qq.com * @Date: 2024-10-30 15:34:08 * @LastEditors: shuishen 1109946754@qq.com * @LastEditTime: 2024-11-21 12:18:06 * @FilePath: \bigScreen\src\api\user.js * @Description: * * Copyright (c) 2024 by shuishen, All Rights Reserved. */ import request from 'utils/http' export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key, code) => request({ url: '/blade-auth/oauth/token', method: 'post', headers: { 'Tenant-Id': tenantId, 'Dept-Id': deptId || '', 'Role-Id': roleId || '', 'Captcha-Key': key, 'Captcha-Code': code, }, params: { tenantId, username, password, grant_type: 'password', scope: 'all', type, }, }) export const logout = () => request({ url: '/blade-auth/oauth/logout', method: 'get', authorization: false, }) export const refreshToken = (refresh_token, tenantId, deptId, roleId) => request({ url: '/blade-auth/oauth/token', method: 'post', headers: { 'Tenant-Id': tenantId, 'Dept-Id': deptId || '', 'Role-Id': roleId || '', }, params: { tenantId, refresh_token, grant_type: 'refresh_token', scope: 'all', }, })