Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marketing-web
marketing
Commits
80da4daf
Commit
80da4daf
authored
Jul 15, 2021
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复短信营销-短信模板插入链接的bug
parent
3a823290
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
addTemp.vue
src/views/message/addTemp.vue
+8
-2
No files found.
src/views/message/addTemp.vue
View file @
80da4daf
...
...
@@ -155,8 +155,14 @@ export default {
}
this
.
form
.
content
=
value
;
// 如果是复制的链接,提示链接后面需要保留一个空格,如果用户不添加空格则无法保存
const
urlReg
=
/
(\s
https
?
|ftp|file
)
:
\/\/[
-A-Za-z0-9+&@#
\/
%?=~_|!:,.;
]
+
[
-A-Za-z0-9+&@#
\/
%=~_|
]\s
/g
;
if
(
!
urlReg
.
test
(
value
))
{
const
urlReg
=
/
(
https
?
|ftp|file
)
:
\/\/[
-A-Za-z0-9+&@#
\/
%?=~_|!:,.;
]
+
[
-A-Za-z0-9+&@#
\/
%=~_|
]
/g
;
let
validate
=
false
;
value
.
replace
(
urlReg
,
(
str
,
$1
,
index
)
=>
{
if
(
!
validate
)
{
validate
=
value
[
index
-
1
]
!=
' '
||
value
[
index
+
str
.
length
]
!=
' '
;
}
}
);
if
(
validate
)
{
return
callback
(
new
Error
(
'链接前面和后面需要保留一个空格!'
));
}
callback
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment