Commit 3c09a493 authored by 邓超's avatar 邓超

fix: 修复产品配置url有斜杠会报错问题

parent 97204cbb
Pipeline #71840 passed with stages
...@@ -31,6 +31,9 @@ const AddForm = props => { ...@@ -31,6 +31,9 @@ const AddForm = props => {
if (addType === 1) { if (addType === 1) {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let arr = obj.pageUrl.split('/'); // 用const声明常量 let arr = obj.pageUrl.split('/'); // 用const声明常量
if (!arr[0]) {
arr.shift();
}
const product = allProductList.find(item => item.PackageName.includes(arr[0])); const product = allProductList.find(item => item.PackageName.includes(arr[0]));
if (product) { if (product) {
if (arr.length > 1) { if (arr.length > 1) {
......
...@@ -153,8 +153,11 @@ const EditForm = props => { ...@@ -153,8 +153,11 @@ const EditForm = props => {
} }
let arr = obj.pageUrl.split('/'); // 用const声明常量 let arr = obj.pageUrl.split('/'); // 用const声明常量
if (!arr[0]) {
arr.shift();
}
const product = allProductList.find(item => item.PackageName.includes(arr[0])); const product = allProductList.find(item => item.PackageName.includes(arr[0]));
console.log(product, 'product');
if (product) { if (product) {
arr.shift(); arr.shift();
obj.pageUrl = arr.join('/'); obj.pageUrl = arr.join('/');
......
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