增加链接输入提示
This commit is contained in:
parent
b62bfa0844
commit
266b25a2ea
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="ui form">
|
||||
<div class="required field" ng-class="{error:urlError}">
|
||||
<label>书签链接</label>
|
||||
<input type="text" placeholder="" ng-model="url">
|
||||
<input type="text" placeholder="输入网址,如:http://mybookmark.cn/" ng-model="url">
|
||||
</div>
|
||||
<div class="required field" ng-class="{error:titleError}">
|
||||
<label>书签标题</label>
|
||||
|
|
|
|||
Loading…
Reference in New Issue