mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-10 16:12:50 +00:00
兼容
This commit is contained in:
parent
d88a878856
commit
baccc7c3d1
@ -184,6 +184,18 @@ export class PluginCenterService {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
private getConfig(config: any) {
|
private getConfig(config: any) {
|
||||||
|
// 处理配置为字符串的情况
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
try {
|
||||||
|
config = JSON.parse(config);
|
||||||
|
} catch (e) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果配置为空或非对象类型,则返回空对象
|
||||||
|
if (!config || typeof config !== 'object') {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
const env = this.app.getEnv();
|
const env = this.app.getEnv();
|
||||||
let isMulti = false;
|
let isMulti = false;
|
||||||
for (const key in config) {
|
for (const key in config) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user