Saber/src/api/user.js

50 lines
982 B
JavaScript
Raw Normal View History

2019-02-14 11:38:09 +08:00
import request from '@/router/axios';
2019-02-21 22:34:21 +08:00
import {baseUrl} from '@/config/env';
2019-02-14 17:36:47 +08:00
2019-08-04 23:26:08 +08:00
export const loginByUsername = (tenantId, account, password, type) => request({
2019-02-22 21:52:18 +08:00
url: '/api/blade-auth/token',
2019-02-21 22:34:21 +08:00
method: 'post',
2019-02-22 21:49:38 +08:00
params: {
2019-08-04 23:26:08 +08:00
tenantId,
2019-02-21 22:34:21 +08:00
account,
password,
type
}
2019-02-14 11:38:09 +08:00
})
2019-02-15 16:09:39 +08:00
export const getButtons = () => request({
2019-02-22 21:52:18 +08:00
url: '/api/blade-system/menu/buttons',
2019-02-21 22:34:21 +08:00
method: 'get'
2019-02-15 16:09:39 +08:00
});
2019-02-14 11:38:09 +08:00
export const getUserInfo = () => request({
2019-02-21 22:34:21 +08:00
url: baseUrl + '/user/getUserInfo',
method: 'get'
2019-02-14 11:38:09 +08:00
});
export const refeshToken = () => request({
2019-02-21 22:34:21 +08:00
url: baseUrl + '/user/refesh',
method: 'post'
2019-02-14 11:38:09 +08:00
})
export const getMenu = () => request({
2019-02-22 21:52:18 +08:00
url: '/api/blade-system/menu/routes',
2019-02-21 22:34:21 +08:00
method: 'get'
2019-02-14 11:38:09 +08:00
});
export const getTopMenu = () => request({
2019-02-21 22:34:21 +08:00
url: baseUrl + '/user/getTopMenu',
method: 'get'
2019-02-14 11:38:09 +08:00
});
export const sendLogs = (list) => request({
2019-02-21 22:34:21 +08:00
url: baseUrl + '/user/logout',
method: 'post',
data: list
2019-02-14 11:38:09 +08:00
})
export const logout = () => request({
2019-02-21 22:34:21 +08:00
url: baseUrl + '/user/logout',
method: 'get'
2019-02-14 17:36:47 +08:00
})