123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- 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:'account'
- }
- })
- }
- // 获取用户信息
- const userInfo = () => {
- return http.request({
- url: '/blade-user/info',
- method: 'GET',
- })
- }
- // 获取版本
- const getVersion = (params) => {
- return http.request({
- url: '/store-goods/appversion/getLatestVersion',
- method: 'GET',
- params
- })
- }
- // 授权获取token
- const empowerToken = (params) => {
- return http.request({
- url: '/blade-auth/oauth/token',
- method: 'POST',
- params: {
- ...params,
- grant_type: "password",
- scope: "all",
- type: 'account'
- }
- })
- }
- // 授权获取手机号
- const tokenTwo = (params) => {
- return http.request({
- url: '/blade-client/wechat/programLogin',
- method: 'get',
- params
- })
- }
- // 获取个人资料信息
- const user = (params) => {
- return http.request({
- url: '/blade-purchase-sales/appParts/personalInformation',
- method: 'get',
- params
- })
- }
- export default {
- token,
- userInfo,
- getVersion,
- empowerToken,
- tokenTwo,
- user
- }
|