| | |
| | | let filterSql = (sl) => { |
| | | if (!sl) return |
| | | |
| | | let _sl = sl.replace(/\/\*[^*/]+\*\//g, '') |
| | | let cutreg = /[\u4E00-\u9FA5。!,、]+/ig |
| | | let tbs = sl.match(cutreg) |
| | | let tbs = _sl.match(cutreg) |
| | | |
| | | if (!tbs) return |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | let getuuid = () => { |
| | | let uuid = [] |
| | | let _options = '0123456789abcdefghigklmnopqrstuv' |
| | | for (let i = 0; i < 19; i++) { |
| | | uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) |
| | | } |
| | | return uuid.join('') |
| | | } |
| | | |
| | | let filterSql = (sl) => { |
| | | if (!sl) return |
| | | |
| | | let arr = [] |
| | | |
| | | sl = sl.replace(/\/\*[^*/]+\*\//g, (word) => { |
| | | let uuid = getuuid() |
| | | arr.push({id: `/*${uuid}*/`, value: word}) |
| | | return `/*${uuid}*/` |
| | | }) |
| | | |
| | | regs.forEach(item => { |
| | | sl = sl.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | arr.forEach(item => { |
| | | sl = sl.replace(item.id, item.value) |
| | | }) |
| | | |
| | | return sl |
| | | } |
| | | |