From 8ae7334be303f4659c3d73cc6e5a5c76d95d4fee Mon Sep 17 00:00:00 2001 From: asd Date: Mon, 2 Dec 2019 17:38:42 +0800 Subject: [PATCH] biaoqian --- controllers/grouping.js | 3 +++ controllers/label.js | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/controllers/grouping.js b/controllers/grouping.js index 28019b4..1b0b1e7 100644 --- a/controllers/grouping.js +++ b/controllers/grouping.js @@ -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 = "删除成功" diff --git a/controllers/label.js b/controllers/label.js index 59ae797..3771281 100644 --- a/controllers/label.js +++ b/controllers/label.js @@ -1,6 +1,17 @@ // 获取标签 var getlabel = async (ctx,next)=>{ - await IDBOpenDBRequest.find('label').then((res)=>{ - + await dbs.find("label").then((res) => { + console.log(res) }) -} \ No newline at end of file + +} + +//添加标签 +var addlabel=async(ctx,next)=>{ + await dbs.add("label", {labelname:ctx.query.labelname}) + ctx.body = "添加成功" +} +module.exports = { + 'GET /addlabel': addlabel, + 'GET /getlabel': getlabel, +}; \ No newline at end of file