diff --git a/public/scripts/controllers/edit-controller.js b/public/scripts/controllers/edit-controller.js index 5452a14..2bb2f6c 100644 --- a/public/scripts/controllers/edit-controller.js +++ b/public/scripts/controllers/edit-controller.js @@ -87,6 +87,11 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', 'bookmarkService', 'p tags: selectedTags, description: $scope.description } + if (!/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/.test($scope.url)) { + toastr.error('检撤到您的书签链接非法,是否忘记加http或者https了?建议直接从打开浏览器地址栏复制出来直接粘贴到输入框。', "错误"); + return; + } + if ($scope.add) { bookmarkService.addBookmark(params) .then((data) => { diff --git a/public/views/edit.html b/public/views/edit.html index e90eeb8..a02546d 100644 --- a/public/views/edit.html +++ b/public/views/edit.html @@ -7,7 +7,7 @@
- +