From 21997956e5b4cfb214ad3dee27bc257dff0e4617 Mon Sep 17 00:00:00 2001 From: dailer Date: Thu, 22 Jul 2021 19:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=20fix:=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BAconsole.error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/6.inject.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/6.inject.js b/src/core/6.inject.js index 28f310b86..90c7fcc5e 100644 --- a/src/core/6.inject.js +++ b/src/core/6.inject.js @@ -138,7 +138,7 @@ BI.Modules = BI.Modules || { getModule: function (type) { if (!moduleInjection[type]) { - throw new Error("module: [" + type + "] 未定义"); + _global.console && console.error("module: [" + type + "] 未定义"); } return moduleInjection[type]; }, @@ -150,7 +150,7 @@ BI.Constants = BI.Constants || { getConstant: function (type) { if (!constantInjection[type]) { - throw new Error("constant: [" + type + "] 未定义"); + _global.console && console.error("constant: [" + type + "] 未定义"); } return constantInjection[type]; } @@ -197,7 +197,7 @@ BI.Models = BI.Models || { getModel: function (type, config) { if (!modelInjection[type]) { - throw new Error("model: [" + type + "] 未定义"); + _global.console && console.error("model: [" + type + "] 未定义"); } var inst = new modelInjection[type](config); inst._constructor && inst._constructor(config); @@ -212,7 +212,7 @@ BI.Stores = BI.Stores || { getStore: function (type, config) { if (!storeInjection[type]) { - throw new Error("store: [" + type + "] 未定义"); + _global.console && console.error("store: [" + type + "] 未定义"); } if (stores[type]) { return stores[type]; @@ -231,7 +231,7 @@ BI.Services = BI.Services || { getService: function (type, config) { if (!serviceInjection[type]) { - throw new Error("service: [" + type + "] 未定义"); + _global.console && console.error("service: [" + type + "] 未定义"); } if (services[type]) { return services[type]; @@ -248,7 +248,7 @@ BI.Providers = BI.Providers || { getProvider: function (type, config) { if (!providerInjection[type]) { - throw new Error("provider: [" + type + "] 未定义"); + _global.console && console.error("provider: [" + type + "] 未定义"); } if (!providers[type]) { providers[type] = new providerInjection[type]();