diff --git a/src/controller/api.js b/src/controller/api.js index 7c5894f..381cc5c 100644 --- a/src/controller/api.js +++ b/src/controller/api.js @@ -225,6 +225,10 @@ module.exports = class extends Base { } } let data = await this.model("bookmarks").add(bookmark); + await this.model('tags').where({ + userId: this.ctx.state.user.id, + id: bookmark.tagId + }).update({ lastUse: think.datetime(new Date()) }); this.json({ code: 0, data, msg: `书签 ${bookmark.title} 添加成功` }); } catch (error) { this.json({ code: 1, data: '', msg: error.toString() }); diff --git a/www/scripts/controllers/edit-controller.js b/www/scripts/controllers/edit-controller.js index 9adddde..255c33e 100644 --- a/www/scripts/controllers/edit-controller.js +++ b/www/scripts/controllers/edit-controller.js @@ -105,7 +105,7 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo } $scope.showAddTag = function () { - if ($scope.tags.length < 30) { + if ($scope.tags.length < 50) { console.log('showAddTag..........') $scope.newTag = ""; dialog = ngDialog.open({ @@ -114,14 +114,14 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo scope: $scope }); } else { - toastr.error('标签个数总数不能超过30个!不允许再添加新分类,如有需求,请联系管理员。', "提示"); + toastr.error('标签个数总数不能超过50个!不允许再添加新分类,如有需求,请联系管理员。', "提示"); } } $scope.addTag = async function (tag) { console.log(tag); - if ($scope.tags.length >= 30) { - toastr.error('标签个数总数不能超过30个!不允许再添加新分类,如有需求,请联系管理员。', "提示"); + if ($scope.tags.length >= 50) { + toastr.error('标签个数总数不能超过50个!不允许再添加新分类,如有需求,请联系管理员。', "提示"); return; } diff --git a/www/scripts/controllers/tags-controller.js b/www/scripts/controllers/tags-controller.js index db88994..b5de8f0 100644 --- a/www/scripts/controllers/tags-controller.js +++ b/www/scripts/controllers/tags-controller.js @@ -273,7 +273,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara $scope.addTag = async function (tag) { console.log(tag); - if ($scope.tags.length >= 30) { + if ($scope.tags.length >= 50) { toastr.error('标签个数总数不能超过30个!不允许再添加新分类,如有需求,请联系管理员。', "提示"); return; }