From 90584683767fb03d9fc6387edf3041602855ae82 Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Wed, 25 Dec 2024 22:19:10 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=88=EF=BC=89=EF=BC=9A=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=95=B4=E4=BD=93=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.js | 20 +++++------ src/api/menu.js | 4 +-- src/api/monitor/cache.js | 14 ++++---- src/api/monitor/job.js | 16 ++++----- src/api/monitor/jobLog.js | 8 ++--- src/api/monitor/online.js | 6 ++-- src/api/monitor/server.js | 2 +- src/api/system/config.js | 16 ++++----- src/api/system/dept.js | 14 ++++---- src/api/system/dict/data.js | 14 ++++---- src/api/system/dict/type.js | 16 ++++----- src/api/{monitor => system}/logininfor.js | 20 +++++------ src/api/system/menu.js | 16 ++++----- src/api/system/notice.js | 12 +++---- src/api/{monitor => system}/operlog.js | 16 ++++----- src/api/system/post.js | 12 +++---- src/api/system/role.js | 36 +++++++++---------- src/api/system/user.js | 30 ++++++++-------- src/api/tool/gen.js | 24 ++++++------- src/plugins/download.js | 6 ++-- src/store/modules/user.js | 4 +-- src/utils/cloud.js | 8 ++--- .../{monitor => system}/logininfor/index.vue | 2 +- .../{monitor => system}/operlog/index.vue | 2 +- 24 files changed, 159 insertions(+), 159 deletions(-) rename src/api/{monitor => system}/logininfor.js (54%) rename src/api/{monitor => system}/operlog.js (52%) rename src/views/{monitor => system}/logininfor/index.vue (99%) rename src/views/{monitor => system}/operlog/index.vue (99%) diff --git a/src/api/login.js b/src/api/login.js index 7b7388f..c159e82 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -9,12 +9,12 @@ export function login(username, password, code, uuid) { uuid } return request({ - url: '/login', + url: '/auth/login', headers: { isToken: false, repeatSubmit: false }, - method: 'post', + method: 'POST', data: data }) } @@ -22,11 +22,11 @@ export function login(username, password, code, uuid) { // 注册方法 export function register(data) { return request({ - url: '/register', + url: '/auth/register', headers: { isToken: false }, - method: 'post', + method: 'POST', data: data }) } @@ -34,27 +34,27 @@ export function register(data) { // 获取用户详细信息 export function getInfo() { return request({ - url: '/getInfo', - method: 'get' + url: '/system/user/getInfo', + method: 'GET' }) } // 退出方法 export function logout() { return request({ - url: '/logout', - method: 'post' + url: '/auth/logout', + method: 'DELETE' }) } // 获取验证码 export function getCodeImg() { return request({ - url: '/captchaImage', + url: '/code', headers: { isToken: false }, - method: 'get', + method: 'GET', timeout: 20000 }) } \ No newline at end of file diff --git a/src/api/menu.js b/src/api/menu.js index faef101..7e779ee 100644 --- a/src/api/menu.js +++ b/src/api/menu.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 获取路由 export const getRouters = () => { return request({ - url: '/getRouters', - method: 'get' + url: '/system/menu/getRouters', + method: 'GET' }) } \ No newline at end of file diff --git a/src/api/monitor/cache.js b/src/api/monitor/cache.js index 72c5f6a..5fa6ce6 100644 --- a/src/api/monitor/cache.js +++ b/src/api/monitor/cache.js @@ -4,7 +4,7 @@ import request from '@/utils/request' export function getCache() { return request({ url: '/monitor/cache', - method: 'get' + method: 'GET' }) } @@ -12,7 +12,7 @@ export function getCache() { export function listCacheName() { return request({ url: '/monitor/cache/getNames', - method: 'get' + method: 'GET' }) } @@ -20,7 +20,7 @@ export function listCacheName() { export function listCacheKey(cacheName) { return request({ url: '/monitor/cache/getKeys/' + cacheName, - method: 'get' + method: 'GET' }) } @@ -28,7 +28,7 @@ export function listCacheKey(cacheName) { export function getCacheValue(cacheName, cacheKey) { return request({ url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey, - method: 'get' + method: 'GET' }) } @@ -36,7 +36,7 @@ export function getCacheValue(cacheName, cacheKey) { export function clearCacheName(cacheName) { return request({ url: '/monitor/cache/clearCacheName/' + cacheName, - method: 'delete' + method: 'DELETE' }) } @@ -44,7 +44,7 @@ export function clearCacheName(cacheName) { export function clearCacheKey(cacheKey) { return request({ url: '/monitor/cache/clearCacheKey/' + cacheKey, - method: 'delete' + method: 'DELETE' }) } @@ -52,6 +52,6 @@ export function clearCacheKey(cacheKey) { export function clearCacheAll() { return request({ url: '/monitor/cache/clearCacheAll', - method: 'delete' + method: 'DELETE' }) } diff --git a/src/api/monitor/job.js b/src/api/monitor/job.js index 3815569..51db0f6 100644 --- a/src/api/monitor/job.js +++ b/src/api/monitor/job.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listJob(query) { return request({ url: '/monitor/job/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listJob(query) { export function getJob(jobId) { return request({ url: '/monitor/job/' + jobId, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function getJob(jobId) { export function addJob(data) { return request({ url: '/monitor/job', - method: 'post', + method: 'POST', data: data }) } @@ -30,7 +30,7 @@ export function addJob(data) { export function updateJob(data) { return request({ url: '/monitor/job', - method: 'put', + method: 'PUT', data: data }) } @@ -39,7 +39,7 @@ export function updateJob(data) { export function delJob(jobId) { return request({ url: '/monitor/job/' + jobId, - method: 'delete' + method: 'DELETE' }) } @@ -51,7 +51,7 @@ export function changeJobStatus(jobId, status) { } return request({ url: '/monitor/job/changeStatus', - method: 'put', + method: 'PUT', data: data }) } @@ -65,7 +65,7 @@ export function runJob(jobId, jobGroup) { } return request({ url: '/monitor/job/run', - method: 'put', + method: 'PUT', data: data }) } \ No newline at end of file diff --git a/src/api/monitor/jobLog.js b/src/api/monitor/jobLog.js index 6e0be61..ec9e5e6 100644 --- a/src/api/monitor/jobLog.js +++ b/src/api/monitor/jobLog.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listJobLog(query) { return request({ url: '/monitor/jobLog/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listJobLog(query) { export function delJobLog(jobLogId) { return request({ url: '/monitor/jobLog/' + jobLogId, - method: 'delete' + method: 'DELETE' }) } @@ -21,6 +21,6 @@ export function delJobLog(jobLogId) { export function cleanJobLog() { return request({ url: '/monitor/jobLog/clean', - method: 'delete' + method: 'DELETE' }) } diff --git a/src/api/monitor/online.js b/src/api/monitor/online.js index bd22137..3a0fd47 100644 --- a/src/api/monitor/online.js +++ b/src/api/monitor/online.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function list(query) { return request({ url: '/monitor/online/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,6 +13,6 @@ export function list(query) { export function forceLogout(tokenId) { return request({ url: '/monitor/online/' + tokenId, - method: 'delete' + method: 'DELETE' }) } diff --git a/src/api/monitor/server.js b/src/api/monitor/server.js index e1f9ca2..492b4be 100644 --- a/src/api/monitor/server.js +++ b/src/api/monitor/server.js @@ -4,6 +4,6 @@ import request from '@/utils/request' export function getServer() { return request({ url: '/monitor/server', - method: 'get' + method: 'GET' }) } \ No newline at end of file diff --git a/src/api/system/config.js b/src/api/system/config.js index a404d82..bc3d35c 100644 --- a/src/api/system/config.js +++ b/src/api/system/config.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listConfig(query) { return request({ url: '/system/config/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listConfig(query) { export function getConfig(configId) { return request({ url: '/system/config/' + configId, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function getConfig(configId) { export function getConfigKey(configKey) { return request({ url: '/system/config/configKey/' + configKey, - method: 'get' + method: 'GET' }) } @@ -29,7 +29,7 @@ export function getConfigKey(configKey) { export function addConfig(data) { return request({ url: '/system/config', - method: 'post', + method: 'POST', data: data }) } @@ -38,7 +38,7 @@ export function addConfig(data) { export function updateConfig(data) { return request({ url: '/system/config', - method: 'put', + method: 'PUT', data: data }) } @@ -47,7 +47,7 @@ export function updateConfig(data) { export function delConfig(configId) { return request({ url: '/system/config/' + configId, - method: 'delete' + method: 'DELETE' }) } @@ -55,6 +55,6 @@ export function delConfig(configId) { export function refreshCache() { return request({ url: '/system/config/refreshCache', - method: 'delete' + method: 'DELETE' }) } diff --git a/src/api/system/dept.js b/src/api/system/dept.js index fc943cd..fe1a519 100644 --- a/src/api/system/dept.js +++ b/src/api/system/dept.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listDept(query) { return request({ url: '/system/dept/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listDept(query) { export function listDeptExcludeChild(deptId) { return request({ url: '/system/dept/list/exclude/' + deptId, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function listDeptExcludeChild(deptId) { export function getDept(deptId) { return request({ url: '/system/dept/' + deptId, - method: 'get' + method: 'GET' }) } @@ -29,7 +29,7 @@ export function getDept(deptId) { export function addDept(data) { return request({ url: '/system/dept', - method: 'post', + method: 'POST', data: data }) } @@ -38,7 +38,7 @@ export function addDept(data) { export function updateDept(data) { return request({ url: '/system/dept', - method: 'put', + method: 'PUT', data: data }) } @@ -47,6 +47,6 @@ export function updateDept(data) { export function delDept(deptId) { return request({ url: '/system/dept/' + deptId, - method: 'delete' + method: 'DELETE' }) } \ No newline at end of file diff --git a/src/api/system/dict/data.js b/src/api/system/dict/data.js index 6c9eb79..66c71d2 100644 --- a/src/api/system/dict/data.js +++ b/src/api/system/dict/data.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listData(query) { return request({ url: '/system/dict/data/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listData(query) { export function getData(dictCode) { return request({ url: '/system/dict/data/' + dictCode, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function getData(dictCode) { export function getDicts(dictType) { return request({ url: '/system/dict/data/type/' + dictType, - method: 'get' + method: 'GET' }) } @@ -29,7 +29,7 @@ export function getDicts(dictType) { export function addData(data) { return request({ url: '/system/dict/data', - method: 'post', + method: 'POST', data: data }) } @@ -38,7 +38,7 @@ export function addData(data) { export function updateData(data) { return request({ url: '/system/dict/data', - method: 'put', + method: 'PUT', data: data }) } @@ -47,6 +47,6 @@ export function updateData(data) { export function delData(dictCode) { return request({ url: '/system/dict/data/' + dictCode, - method: 'delete' + method: 'DELETE' }) } diff --git a/src/api/system/dict/type.js b/src/api/system/dict/type.js index a0254ba..dd924b4 100644 --- a/src/api/system/dict/type.js +++ b/src/api/system/dict/type.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listType(query) { return request({ url: '/system/dict/type/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listType(query) { export function getType(dictId) { return request({ url: '/system/dict/type/' + dictId, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function getType(dictId) { export function addType(data) { return request({ url: '/system/dict/type', - method: 'post', + method: 'POST', data: data }) } @@ -30,7 +30,7 @@ export function addType(data) { export function updateType(data) { return request({ url: '/system/dict/type', - method: 'put', + method: 'PUT', data: data }) } @@ -39,7 +39,7 @@ export function updateType(data) { export function delType(dictId) { return request({ url: '/system/dict/type/' + dictId, - method: 'delete' + method: 'DELETE' }) } @@ -47,7 +47,7 @@ export function delType(dictId) { export function refreshCache() { return request({ url: '/system/dict/type/refreshCache', - method: 'delete' + method: 'DELETE' }) } @@ -55,6 +55,6 @@ export function refreshCache() { export function optionselect() { return request({ url: '/system/dict/type/optionselect', - method: 'get' + method: 'GET' }) } diff --git a/src/api/monitor/logininfor.js b/src/api/system/logininfor.js similarity index 54% rename from src/api/monitor/logininfor.js rename to src/api/system/logininfor.js index 4d112b7..e5b1f11 100644 --- a/src/api/monitor/logininfor.js +++ b/src/api/system/logininfor.js @@ -1,34 +1,34 @@ -import request from '@/utils/request' +import request from '@/utils/request.js' // 查询登录日志列表 export function list(query) { return request({ - url: '/monitor/logininfor/list', - method: 'get', - params: query + url: '/system/logininfor/list', + method: 'POST', + data: query }) } // 删除登录日志 export function delLogininfor(infoId) { return request({ - url: '/monitor/logininfor/' + infoId, - method: 'delete' + url: '/system/logininfor/' + infoId, + method: 'DELETE' }) } // 解锁用户登录状态 export function unlockLogininfor(userName) { return request({ - url: '/monitor/logininfor/unlock/' + userName, - method: 'get' + url: '/system/logininfor/unlock/' + userName, + method: 'GET' }) } // 清空登录日志 export function cleanLogininfor() { return request({ - url: '/monitor/logininfor/clean', - method: 'delete' + url: '/system/logininfor/clean', + method: 'DELETE' }) } diff --git a/src/api/system/menu.js b/src/api/system/menu.js index f6415c6..2b9992d 100644 --- a/src/api/system/menu.js +++ b/src/api/system/menu.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listMenu(query) { return request({ url: '/system/menu/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listMenu(query) { export function getMenu(menuId) { return request({ url: '/system/menu/' + menuId, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function getMenu(menuId) { export function treeselect() { return request({ url: '/system/menu/treeselect', - method: 'get' + method: 'GET' }) } @@ -29,7 +29,7 @@ export function treeselect() { export function roleMenuTreeselect(roleId) { return request({ url: '/system/menu/roleMenuTreeselect/' + roleId, - method: 'get' + method: 'GET' }) } @@ -37,7 +37,7 @@ export function roleMenuTreeselect(roleId) { export function addMenu(data) { return request({ url: '/system/menu', - method: 'post', + method: 'POST', data: data }) } @@ -46,7 +46,7 @@ export function addMenu(data) { export function updateMenu(data) { return request({ url: '/system/menu', - method: 'put', + method: 'PUT', data: data }) } @@ -55,6 +55,6 @@ export function updateMenu(data) { export function delMenu(menuId) { return request({ url: '/system/menu/' + menuId, - method: 'delete' + method: 'DELETE' }) } \ No newline at end of file diff --git a/src/api/system/notice.js b/src/api/system/notice.js index c274ea5..0c4dd4c 100644 --- a/src/api/system/notice.js +++ b/src/api/system/notice.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listNotice(query) { return request({ url: '/system/notice/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listNotice(query) { export function getNotice(noticeId) { return request({ url: '/system/notice/' + noticeId, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function getNotice(noticeId) { export function addNotice(data) { return request({ url: '/system/notice', - method: 'post', + method: 'POST', data: data }) } @@ -30,7 +30,7 @@ export function addNotice(data) { export function updateNotice(data) { return request({ url: '/system/notice', - method: 'put', + method: 'PUT', data: data }) } @@ -39,6 +39,6 @@ export function updateNotice(data) { export function delNotice(noticeId) { return request({ url: '/system/notice/' + noticeId, - method: 'delete' + method: 'DELETE' }) } \ No newline at end of file diff --git a/src/api/monitor/operlog.js b/src/api/system/operlog.js similarity index 52% rename from src/api/monitor/operlog.js rename to src/api/system/operlog.js index a04bca8..6762ba0 100644 --- a/src/api/monitor/operlog.js +++ b/src/api/system/operlog.js @@ -1,26 +1,26 @@ -import request from '@/utils/request' +import request from '@/utils/request.js' // 查询操作日志列表 export function list(query) { return request({ - url: '/monitor/operlog/list', - method: 'get', - params: query + url: '/system/operlog/list', + method: 'POST', + data: query }) } // 删除操作日志 export function delOperlog(operId) { return request({ - url: '/monitor/operlog/' + operId, - method: 'delete' + url: '/system/operlog/' + operId, + method: 'DELETE' }) } // 清空操作日志 export function cleanOperlog() { return request({ - url: '/monitor/operlog/clean', - method: 'delete' + url: '/system/operlog/clean', + method: 'DELETE' }) } diff --git a/src/api/system/post.js b/src/api/system/post.js index 1a8e9ca..1dbbc81 100644 --- a/src/api/system/post.js +++ b/src/api/system/post.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listPost(query) { return request({ url: '/system/post/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listPost(query) { export function getPost(postId) { return request({ url: '/system/post/' + postId, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function getPost(postId) { export function addPost(data) { return request({ url: '/system/post', - method: 'post', + method: 'POST', data: data }) } @@ -30,7 +30,7 @@ export function addPost(data) { export function updatePost(data) { return request({ url: '/system/post', - method: 'put', + method: 'PUT', data: data }) } @@ -39,6 +39,6 @@ export function updatePost(data) { export function delPost(postId) { return request({ url: '/system/post/' + postId, - method: 'delete' + method: 'DELETE' }) } diff --git a/src/api/system/role.js b/src/api/system/role.js index f13e6f4..fca1083 100644 --- a/src/api/system/role.js +++ b/src/api/system/role.js @@ -4,8 +4,8 @@ import request from '@/utils/request' export function listRole(query) { return request({ url: '/system/role/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -13,7 +13,7 @@ export function listRole(query) { export function getRole(roleId) { return request({ url: '/system/role/' + roleId, - method: 'get' + method: 'GET' }) } @@ -21,7 +21,7 @@ export function getRole(roleId) { export function addRole(data) { return request({ url: '/system/role', - method: 'post', + method: 'POST', data: data }) } @@ -30,7 +30,7 @@ export function addRole(data) { export function updateRole(data) { return request({ url: '/system/role', - method: 'put', + method: 'PUT', data: data }) } @@ -39,7 +39,7 @@ export function updateRole(data) { export function dataScope(data) { return request({ url: '/system/role/dataScope', - method: 'put', + method: 'PUT', data: data }) } @@ -52,7 +52,7 @@ export function changeRoleStatus(roleId, status) { } return request({ url: '/system/role/changeStatus', - method: 'put', + method: 'PUT', data: data }) } @@ -61,25 +61,25 @@ export function changeRoleStatus(roleId, status) { export function delRole(roleId) { return request({ url: '/system/role/' + roleId, - method: 'delete' + method: 'DELETE' }) } // 查询角色已授权用户列表 export function allocatedUserList(query) { return request({ - url: '/system/role/authUser/allocatedList', - method: 'get', - params: query + url: '/system/role/authUser/allocatedlist', + method: 'POST', + data: query }) } // 查询角色未授权用户列表 export function unallocatedUserList(query) { return request({ - url: '/system/role/authUser/unallocatedList', - method: 'get', - params: query + url: '/system/role/authUser/unallocatedlist', + method: 'POST', + data: query }) } @@ -87,7 +87,7 @@ export function unallocatedUserList(query) { export function authUserCancel(data) { return request({ url: '/system/role/authUser/cancel', - method: 'put', + method: 'PUT', data: data }) } @@ -96,7 +96,7 @@ export function authUserCancel(data) { export function authUserCancelAll(data) { return request({ url: '/system/role/authUser/cancelAll', - method: 'put', + method: 'PUT', params: data }) } @@ -105,7 +105,7 @@ export function authUserCancelAll(data) { export function authUserSelectAll(data) { return request({ url: '/system/role/authUser/selectAll', - method: 'put', + method: 'PUT', params: data }) } @@ -114,6 +114,6 @@ export function authUserSelectAll(data) { export function deptTreeSelect(roleId) { return request({ url: '/system/role/deptTree/' + roleId, - method: 'get' + method: 'GET' }) } diff --git a/src/api/system/user.js b/src/api/system/user.js index 152f48f..764ac6e 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -5,8 +5,8 @@ import { parseStrEmpty } from "@/utils/cloud"; export function listUser(query) { return request({ url: '/system/user/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -14,7 +14,7 @@ export function listUser(query) { export function getUser(userId) { return request({ url: '/system/user/' + parseStrEmpty(userId), - method: 'get' + method: 'GET' }) } @@ -22,7 +22,7 @@ export function getUser(userId) { export function addUser(data) { return request({ url: '/system/user', - method: 'post', + method: 'POST', data: data }) } @@ -31,7 +31,7 @@ export function addUser(data) { export function updateUser(data) { return request({ url: '/system/user', - method: 'put', + method: 'PUT', data: data }) } @@ -40,7 +40,7 @@ export function updateUser(data) { export function delUser(userId) { return request({ url: '/system/user/' + userId, - method: 'delete' + method: 'DELETE' }) } @@ -52,7 +52,7 @@ export function resetUserPwd(userId, password) { } return request({ url: '/system/user/resetPwd', - method: 'put', + method: 'PUT', data: data }) } @@ -65,7 +65,7 @@ export function changeUserStatus(userId, status) { } return request({ url: '/system/user/changeStatus', - method: 'put', + method: 'PUT', data: data }) } @@ -74,7 +74,7 @@ export function changeUserStatus(userId, status) { export function getUserProfile() { return request({ url: '/system/user/profile', - method: 'get' + method: 'GET' }) } @@ -82,7 +82,7 @@ export function getUserProfile() { export function updateUserProfile(data) { return request({ url: '/system/user/profile', - method: 'put', + method: 'PUT', data: data }) } @@ -95,7 +95,7 @@ export function updateUserPwd(oldPassword, newPassword) { } return request({ url: '/system/user/profile/updatePwd', - method: 'put', + method: 'PUT', data: data }) } @@ -104,7 +104,7 @@ export function updateUserPwd(oldPassword, newPassword) { export function uploadAvatar(data) { return request({ url: '/system/user/profile/avatar', - method: 'post', + method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, data: data }) @@ -114,7 +114,7 @@ export function uploadAvatar(data) { export function getAuthRole(userId) { return request({ url: '/system/user/authRole/' + userId, - method: 'get' + method: 'GET' }) } @@ -122,7 +122,7 @@ export function getAuthRole(userId) { export function updateAuthRole(data) { return request({ url: '/system/user/authRole', - method: 'put', + method: 'PUT', params: data }) } @@ -131,6 +131,6 @@ export function updateAuthRole(data) { export function deptTreeSelect() { return request({ url: '/system/user/deptTree', - method: 'get' + method: 'GET' }) } diff --git a/src/api/tool/gen.js b/src/api/tool/gen.js index 2075677..a82aaa0 100644 --- a/src/api/tool/gen.js +++ b/src/api/tool/gen.js @@ -4,16 +4,16 @@ import request from '@/utils/request' export function listTable(query) { return request({ url: '/tool/gen/list', - method: 'get', - params: query + method: 'POST', + data: query }) } // 查询db数据库列表 export function listDbTable(query) { return request({ url: '/tool/gen/db/list', - method: 'get', - params: query + method: 'POST', + data: query }) } @@ -21,7 +21,7 @@ export function listDbTable(query) { export function getGenTable(tableId) { return request({ url: '/tool/gen/' + tableId, - method: 'get' + method: 'GET' }) } @@ -29,7 +29,7 @@ export function getGenTable(tableId) { export function updateGenTable(data) { return request({ url: '/tool/gen', - method: 'put', + method: 'PUT', data: data }) } @@ -38,7 +38,7 @@ export function updateGenTable(data) { export function importTable(data) { return request({ url: '/tool/gen/importTable', - method: 'post', + method: 'POST', params: data }) } @@ -47,7 +47,7 @@ export function importTable(data) { export function createTable(data) { return request({ url: '/tool/gen/createTable', - method: 'post', + method: 'POST', params: data }) } @@ -56,7 +56,7 @@ export function createTable(data) { export function previewTable(tableId) { return request({ url: '/tool/gen/preview/' + tableId, - method: 'get' + method: 'GET' }) } @@ -64,7 +64,7 @@ export function previewTable(tableId) { export function delTable(tableId) { return request({ url: '/tool/gen/' + tableId, - method: 'delete' + method: 'DELETE' }) } @@ -72,7 +72,7 @@ export function delTable(tableId) { export function genCode(tableName) { return request({ url: '/tool/gen/genCode/' + tableName, - method: 'get' + method: 'GET' }) } @@ -80,6 +80,6 @@ export function genCode(tableName) { export function synchDb(tableName) { return request({ url: '/tool/gen/synchDb/' + tableName, - method: 'get' + method: 'GET' }) } diff --git a/src/plugins/download.js b/src/plugins/download.js index 4475dbf..b5f365e 100644 --- a/src/plugins/download.js +++ b/src/plugins/download.js @@ -12,7 +12,7 @@ export default { name(name, isDelete = true) { var url = baseURL + "/common/download?fileName=" + encodeURIComponent(name) + "&delete=" + isDelete axios({ - method: 'get', + method: 'GET', url: url, responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } @@ -29,7 +29,7 @@ export default { resource(resource) { var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource); axios({ - method: 'get', + method: 'GET', url: url, responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } @@ -47,7 +47,7 @@ export default { var url = baseURL + url downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", }) axios({ - method: 'get', + method: 'GET', url: url, responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index a5338cc..b8e4e63 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -23,8 +23,8 @@ const useUserStore = defineStore( const uuid = userInfo.uuid return new Promise((resolve, reject) => { login(username, password, code, uuid).then(res => { - setToken(res.data) - this.token = res.data + setToken(res.data.access_token) + this.token = res.data.access_token resolve() }).catch(error => { reject(error) diff --git a/src/utils/cloud.js b/src/utils/cloud.js index 91bf14e..70e300b 100644 --- a/src/utils/cloud.js +++ b/src/utils/cloud.js @@ -59,11 +59,11 @@ export function addDateRange(params, dateRange, propName) { search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}; dateRange = Array.isArray(dateRange) ? dateRange : []; if (typeof (propName) === 'undefined') { - search.params['beginTime'] = dateRange[0]; - search.params['endTime'] = dateRange[1]; + search.beginTime = dateRange[0]; + search.endTime = dateRange[1]; } else { - search.params['begin' + propName] = dateRange[0]; - search.params['end' + propName] = dateRange[1]; + search['begin' + propName] = dateRange[0]; + search['end' + propName] = dateRange[1]; } return search; } diff --git a/src/views/monitor/logininfor/index.vue b/src/views/system/logininfor/index.vue similarity index 99% rename from src/views/monitor/logininfor/index.vue rename to src/views/system/logininfor/index.vue index 017e026..1f0d974 100644 --- a/src/views/monitor/logininfor/index.vue +++ b/src/views/system/logininfor/index.vue @@ -125,7 +125,7 @@