import request from "@/router/axios.js"; /** * 登录 * @param {*} tenantId * @param {*} username * @param {*} password * @param {*} type * @param {*} key * @param {*} code * @returns */ export const loginByUsername = ( tenantId, username, password, type, key, code ) => { return request({ url: "/api/blade-auth/oauth/token", method: "post", headers: { Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0", "Tenant-Id": "000000", "Cross-Method": "CORS", "Content-Type": "application/json", }, params: { tenantId, username, password, grant_type: "password", scope: "all", type, }, }); }; /** * 登出 */ export const logout = () =>{ return request({ url: '/api/blade-auth/oauth/logout', method: 'get', params: {} }) }