|
- 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 getTenantId = (params) => {
- return http.request({
- url: '/api/blade-auth/oauth/getTenantId',
- method: 'get',
- params: {
- ...params
- }
- })
- }
-
- const refreshToken = (refresh_token, tenantId) => {
- return http.request({
- url: '/api/blade-auth/oauth/token',
- method: 'post',
- header: {
- 'Tenant-Id': tenantId
- },
- params: {
- tenantId,
- refresh_token,
- grant_type: "refresh_token",
- scope: "all",
- }
- })
- }
-
- // 获取用户信息
- const userInfo = () => {
- return http.request({
- url: '/api/blade-user/info',
- method: 'GET',
- })
- }
-
- // 获取用户信息
- export const getUser = (id) => {
- return http.request({
- url: '/api/blade-user/detail',
- method: 'GET',
- params: { id }
- })
- }
- export const getUserInfo = () => {
- return http.request({
- url: '/api/blade-user/info',
- method: 'get',
- })
- }
- /* 修改用户信息 */
- const updateInfo = (row) => {
- return http.request({
- url: '/api/blade-user/update-info',
- method: 'post',
- data: row
- })
- }
- // 修改密码
- const updatePassword = (data) => {
- return http.request({
- url: '/api/blade-user/update-password',
- method: 'post',
- params: data
- })
- }
- // 修改密码
- const passwordCheck = (data) => {
- return http.request({
- url: '/api/blade-user/passwordCheck',
- method: 'post',
- params: data
- })
- }
-
- export default {
- token,
- userInfo,
- refreshToken,
- getTenantId,
- updatePassword,
- updateInfo,
- passwordCheck
- }
|