refactor: 项目规范

This commit is contained in:
2025-06-22 10:06:05 +08:00
parent 3ea5a17caa
commit 8de8fbfc26
43 changed files with 143 additions and 119 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
import request from '@/utils/request'
export function describeDeptList(params) {
export function queryDeptList(params) {
return request({
url: 'api/dept',
method: 'get',
@@ -8,11 +8,11 @@ export function describeDeptList(params) {
})
}
export function describeDeptSuperiorTree(ids, exclude) {
export function queryDeptSuperiorTree(ids, exclude) {
exclude = exclude !== undefined ? exclude : false
const data = Array.isArray(ids) ? ids : [ids]
return request({
url: 'api/dept/describeDeptSuperiorTree?exclude=' + exclude,
url: 'api/dept/queryDeptSuperiorTree?exclude=' + exclude,
method: 'post',
data
})
@@ -42,4 +42,4 @@ export function edit(data) {
})
}
export default { add, edit, del, describeDeptList, describeDeptSuperiorTree }
export default { add, edit, del, queryDeptList, queryDeptSuperiorTree }
+7 -7
View File
@@ -1,8 +1,8 @@
import request from '@/utils/request'
export function describeMenuListByPid(pid) {
export function queryMenuListByPid(pid) {
return request({
url: 'api/menus/describeMenuListByPid?pid=' + pid,
url: 'api/menus/queryMenuListByPid?pid=' + pid,
method: 'post'
})
}
@@ -15,18 +15,18 @@ export function getMenus(params) {
})
}
export function describeMenuSuperior(ids) {
export function queryMenuSuperior(ids) {
const data = Array.isArray(ids) ? ids : [ids]
return request({
url: 'api/menus/describeMenuSuperior',
url: 'api/menus/queryMenuSuperior',
method: 'post',
data
})
}
export function describeChildMenuSet(id) {
export function queryChildMenuSet(id) {
return request({
url: 'api/menus/describeChildMenuSet?id=' + id,
url: 'api/menus/queryChildMenuSet?id=' + id,
method: 'post'
})
}
@@ -62,4 +62,4 @@ export function edit(data) {
})
}
export default { add, edit, del, describeMenuListByPid, describeMenuSuperior, getMenus, describeChildMenuSet }
export default { add, edit, del, queryMenuListByPid, queryMenuSuperior, getMenus, queryChildMenuSet }
+4 -4
View File
@@ -1,9 +1,9 @@
import request from '@/utils/request'
// 获取所有的Role
export function describeRoleList() {
export function queryRoleList() {
return request({
url: 'api/roles/describeRoleList',
url: 'api/roles/queryRoleList',
method: 'post'
})
}
@@ -18,7 +18,7 @@ export function add(data) {
export function get(id) {
return request({
url: 'api/roles/describeRoleById',
url: 'api/roles/queryRoleById',
method: 'post',
data: { id: id }
})
@@ -26,7 +26,7 @@ export function get(id) {
export function getLevel() {
return request({
url: 'api/roles/describeRoleLevel',
url: 'api/roles/queryRoleLevel',
method: 'post'
})
}
+1 -1
View File
@@ -67,7 +67,7 @@ export function updateEmail(form) {
export function queryUserMetaPage(query) {
return request({
url: 'api/users/describeUserMetadataOptions',
url: 'api/users/queryUserMetadataOptions',
method: 'post',
data: {
page: 1,
+2 -2
View File
@@ -1,8 +1,8 @@
import request from '@/utils/request'
export function describeEmailConfig() {
export function queryEmailConfig() {
return request({
url: 'api/email/describeEmailConfig',
url: 'api/email/queryEmailConfig',
method: 'post'
})
}
+2 -2
View File
@@ -1,8 +1,8 @@
import request from '@/utils/request'
export function describeQiniuConfig() {
export function queryQiniuConfig() {
return request({
url: 'api/qiNiuContent/describeQiniuConfig',
url: 'api/qiNiuContent/queryQiniuConfig',
method: 'post'
})
}
+4 -4
View File
@@ -1,8 +1,8 @@
import axios from 'axios'
import router from '@/router/routers'
import {Notification} from 'element-ui'
import { Notification } from 'element-ui'
import store from '../store'
import {getToken} from '@/utils/auth'
import { getToken } from '@/utils/auth'
import Config from '@/settings'
import Cookies from 'js-cookie'
@@ -37,7 +37,7 @@ service.interceptors.response.use(
if (error.response.data instanceof Blob && error.response.data.type.toLowerCase().indexOf('json') !== -1) {
const reader = new FileReader()
reader.readAsText(error.response.data, 'utf-8')
reader.onload = function (e) {
reader.onload = function(e) {
const errorMsg = JSON.parse(reader.result).message
Notification.error({
title: errorMsg,
@@ -66,7 +66,7 @@ service.interceptors.response.use(
location.reload()
})
} else if (code === 403) {
router.push({path: '/401'})
router.push({ path: '/401' })
} else {
const errorMsg = error.response.data.message
if (errorMsg !== undefined) {
@@ -56,7 +56,7 @@ export default {
' zone: primary # This is needed for the load balancer\n' +
' profile: ${spring.profiles.active}\n' +
' version: ${info.project.version:}\n' +
' git-version: ${git.commit.id.describe:}\n' +
' git-version: ${git.commit.id.query:}\n' +
' git-commit: ${git.commit.id.abbrev:}\n' +
' git-branch: ${git.branch:}\n' +
'ribbon:\n' +
@@ -24,7 +24,7 @@
<script>
import { describeDeptList } from '@/api/system/dept'
import { queryDeptList } from '@/api/system/dept'
export default {
name: 'CuteDeptTree',
@@ -60,7 +60,7 @@ export default {
params['pid'] = node.data.id
}
setTimeout(() => {
describeDeptList(params).then(res => {
queryDeptList(params).then(res => {
if (resolve) {
resolve(res.content)
} else {
@@ -148,7 +148,7 @@ export default {
return {
show: false,
monitor: null,
url: 'api/monitor/describeServerMonitorInfo',
url: 'api/monitor/queryServerMonitorInfo',
data: {},
cpuInfo: {
tooltip: {
@@ -141,7 +141,7 @@ export default {
getDeptDatas(tree, treeNode, resolve) {
const params = { pid: tree.id }
setTimeout(() => {
crudDept.describeDeptList(params).then(res => {
crudDept.queryDeptList(params).then(res => {
resolve(res.content)
})
}, 100)
@@ -161,7 +161,7 @@ export default {
}
},
getSupDepts(id) {
crudDept.describeDeptSuperiorTree(id, true).then(res => {
crudDept.queryDeptSuperiorTree(id, true).then(res => {
const data = res.content
this.buildDepts(data)
this.depts = data
@@ -178,7 +178,7 @@ export default {
})
},
getDepts() {
crudDept.describeDeptList({ enabled: true }).then(res => {
crudDept.queryDeptList({ enabled: true }).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
@@ -190,7 +190,7 @@ export default {
// 获取弹窗内部门数据
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudDept.describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
crudDept.queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
@@ -208,7 +208,7 @@ export default {
}, 100)
},
getSupDepts(id) {
crudMenu.describeMenuSuperior(id).then(res => {
crudMenu.queryMenuSuperior(id).then(res => {
const children = res.map(function(obj) {
if (!obj.leaf && !obj.children) {
obj.children = null
@@ -122,8 +122,8 @@
<script>
import crudRoles from '@/api/system/role'
import { describeDeptList, describeDeptSuperiorTree } from '@/api/system/dept'
import { describeMenuListByPid, describeChildMenuSet } from '@/api/system/menu'
import { queryDeptList, queryDeptSuperiorTree } from '@/api/system/dept'
import { queryMenuListByPid, queryChildMenuSet } from '@/api/system/menu'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
@@ -168,7 +168,7 @@ export default {
methods: {
getMenuDatas(node, resolve) {
setTimeout(() => {
describeMenuListByPid(node.data.id ? node.data.id : 0).then(res => {
queryMenuListByPid(node.data.id ? node.data.id : 0).then(res => {
resolve(res)
})
}, 100)
@@ -232,7 +232,7 @@ export default {
},
menuChange(menu) {
// 获取该节点的所有子节点,id 包含自身
describeChildMenuSet(menu.id).then(childIds => {
queryChildMenuSet(menu.id).then(childIds => {
// 判断是否在 menuIds 中,如果存在则删除,否则添加
if (this.menuIds.indexOf(menu.id) !== -1) {
for (let i = 0; i < childIds.length; i++) {
@@ -284,7 +284,7 @@ export default {
},
// 获取部门数据
getDepts() {
describeDeptList({ enabled: true }).then(res => {
queryDeptList({ enabled: true }).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
@@ -298,7 +298,7 @@ export default {
depts.forEach(dept => {
ids.push(dept.id)
})
describeDeptSuperiorTree(ids).then(res => {
queryDeptSuperiorTree(ids).then(res => {
const date = res.content
this.buildDepts(date)
this.depts = date
@@ -317,7 +317,7 @@ export default {
// 获取弹窗内部门数据
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
@@ -183,8 +183,8 @@
<script>
import crudUser from '@/api/system/user'
import { isvalidPhone } from '@/utils/validate'
import { describeDeptList, describeDeptSuperiorTree } from '@/api/system/dept'
import { describeRoleList, getLevel } from '@/api/system/role'
import { queryDeptList, queryDeptSuperiorTree } from '@/api/system/dept'
import { queryRoleList, getLevel } from '@/api/system/role'
import { getAllJob } from '@/api/system/job'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
@@ -376,7 +376,7 @@ export default {
this.crud.toQuery()
},
getDepts() {
describeDeptList({ enabled: true }).then(res => {
queryDeptList({ enabled: true }).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
@@ -386,7 +386,7 @@ export default {
})
},
getSupDepts(deptId) {
describeDeptSuperiorTree(deptId).then(res => {
queryDeptSuperiorTree(deptId).then(res => {
const date = res.content
this.buildDepts(date)
this.depts = date
@@ -405,7 +405,7 @@ export default {
// 获取弹窗内部门数据
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
@@ -436,7 +436,7 @@ export default {
},
// 获取弹窗内角色数据
getRoles() {
describeRoleList().then(res => {
queryRoleList().then(res => {
this.roles = res
}).catch(() => { })
},
@@ -27,7 +27,7 @@
</template>
<script>
import { describeEmailConfig, modifyEmailConfig } from '@/api/tools/email'
import { queryEmailConfig, modifyEmailConfig } from '@/api/tools/email'
export default {
name: 'Config',
data() {
@@ -58,7 +58,7 @@ export default {
},
methods: {
init() {
describeEmailConfig().then(res => {
queryEmailConfig().then(res => {
this.form = res
})
},
@@ -36,7 +36,7 @@
</template>
<script>
import { describeQiniuConfig, modifyQiniuConfig } from '@/api/tools/qiniu'
import { queryQiniuConfig, modifyQiniuConfig } from '@/api/tools/qiniu'
export default {
data() {
return {
@@ -63,7 +63,7 @@ export default {
},
methods: {
init() {
describeQiniuConfig().then(res => {
queryQiniuConfig().then(res => {
this.form = res
})
},