From 266b25a2eaf88e5315d5323d8788b22b49f55493 Mon Sep 17 00:00:00 2001 From: luchenqun Date: Wed, 8 Feb 2017 17:25:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=93=BE=E6=8E=A5=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/scripts/controllers/edit-controller.js | 5 +++++ public/views/edit.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 @@
- +