This commit is contained in:
asd 2019-12-02 17:38:42 +08:00
parent 0206f7d3a5
commit 8ae7334be3
2 changed files with 17 additions and 3 deletions

View File

@ -1,9 +1,12 @@
//添加分组
//groupname:分组名 fuid :父分组
// 父分组=0时是一级分组
var groupadd = async (ctx, next) => {
await dbs.add("group", { groupname: ctx.query.groupname, fuid: ctx.query.fuid == null ? '0' : ctx.query.fuid })
ctx.body = "添加成功"
}
// 删除分组
// num_key 操作使用的id
var groupdel = async (ctx, next) => {
await dbs.remove("group", { num_key: parseInt(ctx.query.key) })
ctx.body = "删除成功"

View File

@ -1,6 +1,17 @@
// 获取标签
var getlabel = async (ctx,next)=>{
await IDBOpenDBRequest.find('label').then((res)=>{
await dbs.find("label").then((res) => {
console.log(res)
})
}
//添加标签
var addlabel=async(ctx,next)=>{
await dbs.add("label", {labelname:ctx.query.labelname})
ctx.body = "添加成功"
}
module.exports = {
'GET /addlabel': addlabel,
'GET /getlabel': getlabel,
};