fix(接口测试): 修复windows和linux系统换行符切割的缺陷

--bug=1024736 --user=王孝刚
[接口测试]github#22450接口请求体form-data批量添加后字段存在换行导致接口无法正常测试
https://www.tapd.cn/55049933/s/1354971
This commit is contained in:
wxg0103 2023-03-23 13:52:28 +08:00 committed by fit2-zhao
parent cc26335d1b
commit 032ecdd444
6 changed files with 6 additions and 6 deletions

View File

@ -331,7 +331,7 @@ export default {
}, },
_handleBatchVars(data) { _handleBatchVars(data) {
if (data) { if (data) {
let params = data.split('\n'); let params = data.split(/[(\r\n)\r\n]+/);
let keyValues = []; let keyValues = [];
params.forEach((item) => { params.forEach((item) => {
if (item) { if (item) {

View File

@ -350,7 +350,7 @@ export default {
}, },
batchSave(data) { batchSave(data) {
if (data) { if (data) {
let params = data.split('\n'); let params = data.split(/[(\r\n)\r\n]+/);
let keyValues = []; let keyValues = [];
params.forEach((item) => { params.forEach((item) => {
if (item) { if (item) {

View File

@ -507,7 +507,7 @@ export default {
}, },
batchSave(data) { batchSave(data) {
if (data) { if (data) {
let params = data.split('\n'); let params = data.split(/[(\r\n)\r\n]+/);
let keyValues = []; let keyValues = [];
params.forEach((item) => { params.forEach((item) => {
if (item) { if (item) {

View File

@ -469,7 +469,7 @@ export default {
this.$refs.batchAdd.open(); this.$refs.batchAdd.open();
}, },
_handleBatchVars(data) { _handleBatchVars(data) {
let params = data.split("\n"); let params = data.split(/[(\r\n)\r\n]+/);
let keyValues = []; let keyValues = [];
params.forEach(item => { params.forEach(item => {
if (item) { if (item) {

View File

@ -431,7 +431,7 @@ export default {
return this.items.length - 1 !== index; return this.items.length - 1 !== index;
}, },
_handleBatchVars(data) { _handleBatchVars(data) {
let params = data.split('\n'); let params = data.split(/[(\r\n)\r\n]+/);
let keyValues = []; let keyValues = [];
params.forEach((item) => { params.forEach((item) => {
if (item) { if (item) {

View File

@ -477,7 +477,7 @@ export default {
this.$refs.batchAdd.open(); this.$refs.batchAdd.open();
}, },
_handleBatchVars(data) { _handleBatchVars(data) {
let params = data.split("\n"); let params = data.split(/[(\r\n)\r\n]+/);
let keyValues = []; let keyValues = [];
params.forEach(item => { params.forEach(item => {
if (item) { if (item) {