智慧保安互联网APP
zengh
2022-06-21 4efeb31d5b4921d7e851c256009486ad86bc70e2
api/user.js
New file
@@ -0,0 +1,33 @@
import http from '@/http/api.js'
// 获取token
const token = (tenantId, username, password, type) => {
   return http.request({
      url: '/blade-auth/oauth/token',
      method: 'POST',
      header: {
         'Tenant-Id': tenantId
      },
      params: {
         tenantId,
         username,
         password,
         grant_type: "password",
         scope: "all",
         type
      }
   })
}
// 获取用户信息
const userInfo = () => {
   return http.request({
      url: '/blade-user/info',
      method: 'GET',
   })
}
export default {
   token,
   userInfo
}