添加书签的分类按照最新显示

This commit is contained in:
B05BEE13.卢郴群 2020-09-01 17:00:58 +08:00
parent 6967bcee7a
commit c4dba3cb18
3 changed files with 9 additions and 5 deletions

View File

@ -225,6 +225,10 @@ module.exports = class extends Base {
} }
} }
let data = await this.model("bookmarks").add(bookmark); 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} 添加成功` }); this.json({ code: 0, data, msg: `书签 ${bookmark.title} 添加成功` });
} catch (error) { } catch (error) {
this.json({ code: 1, data: '', msg: error.toString() }); this.json({ code: 1, data: '', msg: error.toString() });

View File

@ -105,7 +105,7 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
} }
$scope.showAddTag = function () { $scope.showAddTag = function () {
if ($scope.tags.length < 30) { if ($scope.tags.length < 50) {
console.log('showAddTag..........') console.log('showAddTag..........')
$scope.newTag = ""; $scope.newTag = "";
dialog = ngDialog.open({ dialog = ngDialog.open({
@ -114,14 +114,14 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
scope: $scope scope: $scope
}); });
} else { } else {
toastr.error('标签个数总数不能超过30个不允许再添加新分类如有需求请联系管理员。', "提示"); toastr.error('标签个数总数不能超过50个不允许再添加新分类如有需求请联系管理员。', "提示");
} }
} }
$scope.addTag = async function (tag) { $scope.addTag = async function (tag) {
console.log(tag); console.log(tag);
if ($scope.tags.length >= 30) { if ($scope.tags.length >= 50) {
toastr.error('标签个数总数不能超过30个不允许再添加新分类如有需求请联系管理员。', "提示"); toastr.error('标签个数总数不能超过50个不允许再添加新分类如有需求请联系管理员。', "提示");
return; return;
} }

View File

@ -273,7 +273,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara
$scope.addTag = async function (tag) { $scope.addTag = async function (tag) {
console.log(tag); console.log(tag);
if ($scope.tags.length >= 30) { if ($scope.tags.length >= 50) {
toastr.error('标签个数总数不能超过30个不允许再添加新分类如有需求请联系管理员。', "提示"); toastr.error('标签个数总数不能超过30个不允许再添加新分类如有需求请联系管理员。', "提示");
return; return;
} }