You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
786 B
23 lines
786 B
2 years ago
|
const router = require('koa-router')()
|
||
|
|
||
|
// 全局路由
|
||
|
router.prefix('/menu')
|
||
|
router.get('/getMenu', async (ctx, next) => {
|
||
|
const [rows, fields] = await global.SQL.execute('SELECT * FROM `menu` WHERE `isdelete` = 0');
|
||
|
ctx.body = rows
|
||
|
})
|
||
|
router.delete('/deleteMenu', async (ctx, next) => {
|
||
|
const [rows, fields] = await global.SQL.execute('SELECT * FROM `menu` WHERE `isdelete` = 0');
|
||
|
ctx.body = rows
|
||
|
})
|
||
|
router.put('/updateMenu', async (ctx, next) => {
|
||
|
const [rows, fields] = await global.SQL.execute('SELECT * FROM `menu` WHERE `isdelete` = 0');
|
||
|
ctx.body = rows
|
||
|
})
|
||
|
router.post('/createMenu', async (ctx, next) => {
|
||
|
const [rows, fields] = await global.SQL.execute('SELECT * FROM `menu` WHERE `isdelete` = 0');
|
||
|
ctx.body = rows
|
||
|
})
|
||
|
|
||
|
module.exports = router
|