完成V1版本

main
expressgy 2 years ago
parent 000cc253eb
commit 03ec028a5f
  1. 28
      routes/container.js

@ -20,6 +20,34 @@ router.get('/', async (ctx, next) => {
message: '获取内容成功'
}
})
router.get('/getPage', async (ctx, next) => {
const arg = ctx.request.query
if (!Object.keys(arg).includes('route')) {
ctx.body = {
data: {},
state: false,
message: '缺少Route'
}
return
}
const [oldRows, oldFields] = await global.SQL.execute('SELECT * FROM `menu` WHERE `isdelete` = 0 AND `route` = ?', [arg.route]);
console.log(oldRows)
if(oldRows.length == 0){
ctx.body = {
data: {},
state: false,
message: '未找到页面'
}
return
}
const [rows, fields] = await global.SQL.execute('SELECT * FROM `container` WHERE `isdelete` = 0 AND `menuId` = ?', [oldRows[0].id]);
ctx.body = {
data: rows,
state: true,
message: '获取内容成功'
}
})
router.delete('/', async (ctx, next) => {
const arg = ctx.request.query
console.log(arg)

Loading…
Cancel
Save