系统管理加前缀path “/system”

This commit is contained in:
吕金泽 2022-03-28 21:21:26 +08:00
parent 178e024cf8
commit 25b91353b1
116 changed files with 240 additions and 474 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
{
"properties" : { },
"id" : "acff5ad7aae64de2acb03e1d16a58ce2",
"name" : "系统功能",
"name" : "系统管理",
"type" : "api",
"parentId" : "0",
"path" : null,
"path" : "/system",
"paths" : [ ],
"options" : [ ]
}

View File

@ -4,12 +4,12 @@
"script" : null,
"groupId" : "f2538e0f370a4cabab0ae920f5e77ae7",
"name" : "删除",
"createTime" : 1648390993959,
"updateTime" : null,
"createTime" : null,
"updateTime" : 1648424795832,
"lock" : null,
"createBy" : null,
"updateBy" : null,
"path" : "delete",
"path" : "/delete",
"method" : "DELETE",
"parameters" : [ ],
"options" : [ ],

View File

@ -0,0 +1,100 @@
{
"properties" : { },
"id" : "bb23ca6e863b41b8ad81994b87a4fc0d",
"script" : null,
"groupId" : "f2538e0f370a4cabab0ae920f5e77ae7",
"name" : "执行生成",
"createTime" : null,
"updateTime" : 1648426498457,
"lock" : null,
"createBy" : null,
"updateBy" : null,
"path" : "/execute",
"method" : "GET",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": \"02df51e4d7184780a98b632f43dc5848\",\n \"timestamp\": 1648309158679,\n \"executeTime\": 8\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "200",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "message",
"value" : "success",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "data",
"value" : "02df51e4d7184780a98b632f43dc5848",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "timestamp",
"value" : "1648309158679",
"description" : "",
"required" : false,
"dataType" : "Long",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "8",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
}
}
================================
import org.ssssssss.magicapi.core.service.MagicResourceService
return MagicResourceService.tree('api').children.filter(it => it.node.path == '')[0].node.id

View File

@ -4,8 +4,8 @@
"script" : null,
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
"name" : "获取用户信息",
"createTime" : 1646490239479,
"updateTime" : 1643710783720,
"createTime" : null,
"updateTime" : 1648431786861,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
@ -18,7 +18,19 @@
"paths" : [ ],
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1643710751531,\n \"executeTime\": null\n}",
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : {
"name" : "",
"value" : "",
@ -95,7 +107,7 @@
}
================================
import 'cn.dev33.satoken.stp.StpUtil';
import "@post:/security/permissions" as authoritiesList;
import "@post:/system/security/permissions" as authoritiesList;
var user = db.table("sys_user").where().eq("id",StpUtil.getLoginId()).selectOne()
user.authorities = authoritiesList()

View File

@ -182,7 +182,7 @@ function reloadTable() {
}
function getSort() {
proxy.$get('dict/sort').then(res => {
proxy.$get('/system/dict/sort').then(res => {
temp.value.sort = res.data
})
}
@ -201,7 +201,7 @@ function save(d) {
dataForm.value.validate((valid) => {
if (valid) {
d.loading()
proxy.$post('dict/save', temp.value).then((response) => {
proxy.$post('/system/dict/save', temp.value).then((response) => {
d.hideLoading()
temp.value.id = response.data
dictDialog.value.hide()

View File

@ -86,7 +86,7 @@ export default {
},
created() {
if (this.externalId) {
this.$get('file/files', { externalId: this.externalId, externalType: this.externalType }).then(res => {
this.$get('/system/file/files', { externalId: this.externalId, externalType: this.externalType }).then(res => {
const { data } = res
this.fileList = data
})

View File

@ -156,7 +156,7 @@ export default {
this.cropperOption = this.cropperConfig || {}
this.cropperOption.img = ''
if (this.externalId) {
this.$get('file/files', { externalId: this.externalId, externalType: this.externalType }).then(res => {
this.$get('/system/file/files', { externalId: this.externalId, externalType: this.externalType }).then(res => {
this.urls = res.data
})
this.action = this.action + `?externalId=${this.externalId}&externalType=${this.externalType}`
@ -218,7 +218,7 @@ export default {
this.urls.forEach(url => {
newUrls.push(encodeURI(url))
})
this.$get('file/resort', { urls: newUrls.join(',') })
this.$get('/system/file/resort', { urls: newUrls.join(',') })
},
onExceed() {
this.$message({
@ -238,7 +238,7 @@ export default {
formData.append('file', dataFile)
formData.append('url', encodeURI(this.cropperOption.relativeImg))
this.$request({
url: 'file/cropper',
url: '/system/file/cropper',
method: 'post',
data: formData
}).then(res => {

View File

@ -22,7 +22,7 @@ export function removeToken() {
export async function getUserInfo() {
await request({
url: 'user/info',
url: '/system/user/info',
method: 'get'
}).then(response => {
const { data } = response
@ -40,7 +40,7 @@ export async function getUserInfo() {
export function login(data){
return new Promise((resolve, reject) => {
request({
url: 'security/login',
url: '/system/security/login',
method: 'post',
data
}).then(res => {
@ -55,7 +55,7 @@ export function login(data){
export function logout(){
request({
url: 'security/logout',
url: '/system/security/logout',
method: 'get'
}).then(() => {
removeToken()

View File

@ -7,7 +7,7 @@ const common = {}
let dictData = []
common.getDictData = async function() {
await request({
url: 'dict/items/all',
url: '/system/dict/items/all',
method: 'get'
}).then((response) => {
const { data } = response
@ -160,7 +160,7 @@ common.getUrl = (url, data) => {
// common.loadConfig = async() => {
// await request({
// url: 'config/list'
// url: '/system/config/list'
// }).then(res => {
// const { data } = res
// global.filePrefix = data.filePrefix

View File

@ -32,7 +32,7 @@ const install = (app) => {
lock: true,
background: 'rgba(255, 255, 255, 0)',
})
app.config.globalProperties.$post('/component/list').then((res) => {
app.config.globalProperties.$post('/system/component/list').then((res) => {
res.data.forEach(it => {
appComponent(app, it)
})

View File

@ -43,7 +43,7 @@ export const loadView = (view) => {
export function generateRoutes(){
return new Promise((resolve, reject) => {
request({
url: 'menu/current/menus',
url: '/system/menu/current/menus',
method: 'post'
}).then(response => {
const { data } = response

View File

@ -12,7 +12,7 @@ import genCode from '@/scripts/gen/gen-mb-list.js'
const { proxy } = getCurrentInstance()
const tableDatas = reactive([])
proxy.$get('/code/gen/columns', { tableName: 'sys_test' }).then(res => {
proxy.$get('/system/code/gen/columns', { tableName: 'sys_test' }).then(res => {
var columns = res.data.columns
var primary = res.data.primary
columns.forEach(it => {
@ -161,7 +161,7 @@ const cols = reactive([{
field: 'dictType',
label: '字典类型',
props: {
url: 'dict/all',
url: '/system/dict/all',
showValue: true
}
}])

View File

@ -104,7 +104,7 @@ const formOptions = reactive({
label: 'treeselect',
rules: [{ required: true, message: '请选择组织机构', trigger: 'change' }],
props: {
url: 'user/offices'
url: '/system/user/offices'
}
}, {
component: 'select',
@ -113,7 +113,7 @@ const formOptions = reactive({
label: 'select',
rules: [{ required: true, message: '请选择角色', trigger: 'change' }],
props: {
url: 'role/all',
url: '/system/role/all',
placeholder: '请选择角色',
multiple: true
}

View File

@ -28,10 +28,10 @@ const listOptions = reactive({
},{
type: 'delete',
permission: 'user:delete',
url: 'user/delete'
url: '/system/user/delete'
}],
table: {
url: 'user/list',
url: '/system/user/list',
where: {
username: {
label: '登录名称',
@ -43,7 +43,7 @@ const listOptions = reactive({
type: 'select',
label: '角色',
props: {
url: 'role/all',
url: '/system/role/all',
el: { multiple: true }
}
}
@ -73,7 +73,7 @@ const listOptions = reactive({
type: 'switch',
width: 100,
change: (row) => {
proxy.$get('/user/change/login/status', {
proxy.$get('/system/user/change/login/status', {
id: row.id,
isLogin: row.isLogin
})
@ -106,7 +106,7 @@ const listOptions = reactive({
icon: 'ElDelete',
click: (row) => {
proxy.$common.handleDelete({
url: 'user/delete',
url: '/system/user/delete',
id: row.id,
done: () => magicList.value.reload()
})
@ -120,7 +120,7 @@ const listOptions = reactive({
const formOptions = reactive({
detail: {
request: {
url: 'user/get'
url: '/system/user/get'
}
},
form: {
@ -166,7 +166,7 @@ const formOptions = reactive({
label: '组织机构',
rules: [{ required: true, message: '请选择组织机构', trigger: 'change' }],
props: {
url: 'user/offices'
url: '/system/user/offices'
}
}, {
component: 'select',
@ -175,7 +175,7 @@ const formOptions = reactive({
label: '选择角色',
rules: [{ required: true, message: '请选择角色', trigger: 'change' }],
props: {
url: 'role/all',
url: '/system/role/all',
placeholder: '请选择角色',
el: { multiple: true }
}

View File

@ -37,7 +37,7 @@
})
const loading = ref(false)
function refreshCode(){
proxy.$get('/security/verification/code').then(res => {
proxy.$get('/system/security/verification/code').then(res => {
codeImg.value = 'data:image/png;base64,' + res.data.img
loginForm.uuid = res.data.uuid
})

View File

@ -16,8 +16,6 @@
</el-row>
</el-tab-pane>
<el-tab-pane label="字段信息" name="field">
<el-button type="primary" @click="getData" style="margin-bottom: 10px">获取数据</el-button>
<el-button type="primary" @click="gen" style="margin-bottom: 10px">代码生成</el-button>
<mb-editor-table v-model="genInfo.columns" :cols="cols" :show-no="false" :operation="false" :toolbar="false" />
</el-tab-pane>
<el-tab-pane label="生成信息" name="gen">
@ -71,6 +69,17 @@
<el-input v-model="genInfo.info.businessPath"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item>
<template #label>
代码生成
<el-tooltip content="接口和页面直接生成到magic-api的api,component" placement="top">
<el-icon><ElQuestionFilled /></el-icon>
</el-tooltip>
</template>
<el-button type="primary" @click="gen" style="margin-bottom: 10px">代码生成</el-button>
</el-form-item>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
@ -84,14 +93,23 @@
const dataForm = ref()
const tables = ref([])
const emit = defineEmits(['reload'])
var validatePath = (rule, value, callback) => {
if(!value.startsWith('/')){
callback(new Error('请以“/”开头'));
}else if(value.endsWith('/')){
callback(new Error('不能以“/”结尾'));
}else{
callback();
}
}
const genInfoRules = reactive({
tableName: [{ required: true, message: '请选择表', trigger: 'change' }],
tableComment: [{ required: true, message: '请输入描述', trigger: 'change' }],
'info.template': [{ required: true, message: '请选择模板', trigger: 'change' }],
'info.moduleName': [{ required: true, message: '请输入模块名称', trigger: 'change' }],
'info.modulePath': [{ required: true, message: '请输入模块路径', trigger: 'change' }],
'info.modulePath': [{ required: true, message: '请输入模块路径', trigger: 'change' }, { validator: validatePath }],
'info.businessName': [{ required: true, message: '请输入功能名称', trigger: 'change' }],
'info.businessPath': [{ required: true, message: '请输入功能路径', trigger: 'change' }]
'info.businessPath': [{ required: true, message: '请输入功能路径', trigger: 'change' }, { validator: validatePath }]
})
const genInfo = ref({
tableName: '',
@ -107,13 +125,13 @@
})
async function watchTableName(){
await proxy.$get('/code/gen/tables').then(res => {
await proxy.$get('/system/code/gen/tables').then(res => {
tables.value = res.data
})
watch(() => genInfo.value.tableName, (value) => {
genInfo.value.tableComment = tables.value.filter(it => it.value == value)[0].label.replace(value, '').replace('(','').replace(')','')
genInfo.value.columns = []
proxy.$get('/code/gen/columns', { tableName: value }).then(res => {
proxy.$get('/system/code/gen/columns', { tableName: value }).then(res => {
var columns = res.data.columns
var primary = res.data.primary
columns.forEach(it => {
@ -274,7 +292,7 @@
field: 'dictType',
label: '字典类型',
props: {
url: 'dict/all',
url: '/system/dict/all',
showValue: true
}
}])
@ -283,10 +301,6 @@
genCode('test', genInfo.value.columns)
}
function getData(){
console.log(genInfo.value.columns)
}
function save(d){
dataForm.value.validate((valid) => {
if (valid) {
@ -294,7 +308,7 @@
formData.info = JSON.stringify(genInfo.value.info)
formData.columns = JSON.stringify(genInfo.value.columns)
d.loading()
proxy.$post('/code/gen/save', formData).then(() => {
proxy.$post('/system/code/gen/save', formData).then(() => {
d.hideLoading()
proxy.$notify({
title: '成功',
@ -312,7 +326,7 @@
}
function getDetail(id){
proxy.$get('/code/gen/get', { id: id }).then(res => {
proxy.$get('/system/code/gen/get', { id: id }).then(res => {
var formData = {...res.data}
formData.info = JSON.parse(formData.info)
formData.columns = JSON.parse(formData.columns)

Some files were not shown because too many files have changed in this diff Show More