1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import http from '@/http/api.js'
- // 获取token
- const token = (tenantId, username, password, type) => {
- return http.request({
- url: '/api/blade-auth/oauth/token',
- method: 'POST',
- header: {
- 'Tenant-Id': tenantId
- },
- params: {
- tenantId,
- username,
- password,
- grant_type: "password",
- scope: "all",
- type
- }
- })
- }
- const refreshToken = (refresh_token, tenantId) => {
- return http.request({
- url: '/api/blade-auth/oauth/token',
- method: 'post',
- headers: {
- 'Tenant-Id': tenantId
- },
- params: {
- tenantId,
- refresh_token,
- grant_type: "refresh_token",
- scope: "all",
- }
- })
- }
- // 获取用户信息
- const userInfo = () => {
- return http.request({
- url: '/api/blade-system/user/info',
- method: 'GET',
- })
- }
- // 获取用户信息
- export const getUser = (id) => {
- return http.request({
- url: '/api/blade-system/user/detail',
- method: 'GET',
- params: { id }
- })
- }
- export default {
- token,
- userInfo,
- refreshToken
- }
|