Commit a30c6c6f authored by Xuguangxing's avatar Xuguangxing

feat: 优化js eval方法

parent a8a504f4
......@@ -3,7 +3,7 @@ import { Context, Service } from 'egg';
// 添加或修改url中的参数
function addOrEditUrlParams (url, paramName, replaceWith) {
if (url.indexOf(paramName) > -1) {
let re = eval('/(' + paramName + '=)([^&]*)/gi');
let re = /(' + paramName + '=)([^&]*)/gi;
url = url.replace(re, paramName + '=' + replaceWith);
} else {
let paraStr = paramName + '=' + replaceWith;
......
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