Commit 179e1026 authored by Jenny's avatar Jenny

fix: 接口地址正则或修改

parent 8de97e72
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
async handleDynamicData (value) { async handleDynamicData (value) {
const that = this const that = this
let { dataUrl, dataMethod, dataFormatter, dataProcessing } = { ...value } let { dataUrl, dataMethod, dataFormatter, dataProcessing } = { ...value }
dataUrl = dataUrl.replace(/^(\/dashboardCharts)?|^(\/dashboardAPI)?/, '') dataUrl = dataUrl.replace(/^(\/(dashboardCharts|dashboardAPI))?/, '')
let res = await that.$u.api[`${dataMethod.toLowerCase()}Http`](dataUrl, dataFormatter, { let res = await that.$u.api[`${dataMethod.toLowerCase()}Http`](dataUrl, dataFormatter, {
custom: { loading: false } custom: { loading: false }
}) })
......
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
*/ */
async getGlobalData(info) { async getGlobalData(info) {
const that = this const that = this
const dataUrl = info.dataUrl.replace(/^(\/dashboardCharts)?|^(\/dashboardAPI)?/, '') const dataUrl = info.dataUrl.replace(/^(\/(dashboardCharts|dashboardAPI))?/, '')
let res = await that.$u.api[`${info.dataMethod.toLowerCase()}Http`](dataUrl, info.dataFormatter, { let res = await that.$u.api[`${info.dataMethod.toLowerCase()}Http`](dataUrl, info.dataFormatter, {
custom: { loading: false } custom: { loading: false }
}) })
......
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
*/ */
async getGlobalData(info) { async getGlobalData(info) {
const that = this const that = this
const dataUrl = info.dataUrl.replace(/^(\/dashboardCharts)?|^(\/dashboardAPI)?/, '') const dataUrl = info.dataUrl.replace(/^(\/(dashboardCharts|dashboardAPI))?/, '')
let res = await that.$u.api[`${info.dataMethod.toLowerCase()}Http`](dataUrl, info.dataFormatter, { let res = await that.$u.api[`${info.dataMethod.toLowerCase()}Http`](dataUrl, info.dataFormatter, {
custom: { loading: false } custom: { loading: false }
}) })
......
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