import config from "@/config" import tool from "@/utils/tool" import http from "@/utils/request" export default { // 登录获取TOKEN token: async function (data = {}) { const query = { username: data.user, password: tool.crypto.encrypt(data.password), code: data.code, uuid: data.uuid } return await http.post(`${config.API_URL}/mes/auth/login`, query); }, // 获取登录验证码 codeImg: async function () { return await http.get(`${config.API_URL}/mes/auth/code`); }, user: { name: "用户管理", url: `${config.API_URL}/mes/sysUser`, get: async function (data = {}) { return await http.post(`${this.url}/getPage`, data); }, all: async function (data = {}) { return await http.post(`${this.url}/getList`, data); }, add: async function (data = {}) { return await http.post(`${this.url}/save`, data); }, edit: async function (data = {}) { return await http.post(`${this.url}/update`, data); }, del: async function (data = {}) { return await http.post(`${this.url}/remove`, data); }, resetPass: async function (data = {}) { return await http.post(`${this.url}/resetPass`, data); }, updatePass: async function (data = {}) { const query = { oldPass: tool.crypto.encrypt(data.userPassword), newPass: tool.crypto.encrypt(data.newPassword) } return await http.post(`${this.url}/updatePass`, query); } } }