Commit 80da4daf by caoyanzhi

fix: 修复短信营销-短信模板插入链接的bug

parent 3a823290
......@@ -155,8 +155,14 @@ export default {
}
this.form.content = value;
// 如果是复制的链接,提示链接后面需要保留一个空格,如果用户不添加空格则无法保存
const urlReg = /(\shttps?|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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment