| | |
| | | Authorization: store.token |
| | | } |
| | | }).then(res => { |
| | | // 密码修改成功后清除token和用户信息 |
| | | store.token = null |
| | | store.user = null |
| | | store.name = null |
| | | store.id = null |
| | | return res.data |
| | | }) |
| | | } |
| | | |
| | | export function register(data) { |
| | | return axios({ |
| | | url: '/api/user/register', |
| | | method: 'post', |
| | | data |
| | | }).then(res => { |
| | | return res.data |
| | | }) |
| | | } |
| | | |
| | | export function getUserApprovalList(params) { |
| | | return axios({ |
| | | url: '/api/user/approval/', |
| | | method: 'get', |
| | | params, |
| | | headers: { |
| | | Authorization: store.token |
| | | } |
| | | }).then(res => { |
| | | return res.data |
| | | }) |
| | | } |
| | | |
| | | export function approveUser(userId, data) { |
| | | return axios({ |
| | | url: `/api/user/approval/${userId}/approve/`, |
| | | method: 'post', |
| | | data, |
| | | headers: { |
| | | Authorization: store.token |
| | | } |
| | | }).then(res => { |
| | | return res.data |
| | | }) |
| | | } |