You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
931 B
35 lines
931 B
// 配置文件来源于2部分,一部分来源于 环境,一部分来源于静态文件的配置; |
|
import { defaultConfig } from "@/config/framework/default-config"; |
|
import { projectConfig } from "@/config/project-config"; |
|
import { $commonService } from "@/services/framework/dependency-injection-service"; |
|
|
|
declare let __APP_ENV__: any; |
|
// 当前环境 |
|
const viteEnv = __APP_ENV__; |
|
console.table(viteEnv); |
|
|
|
export const AppConfigService = { |
|
install(app: any) { |
|
app.config.globalProperties.$configService = new AppConfigServiceClass(); |
|
$commonService.$dependencyInjectionService.provideFun( |
|
"$configService", |
|
app.config.globalProperties.$configService |
|
); |
|
}, |
|
}; |
|
|
|
export class AppConfigServiceClass { |
|
private info: object = {}; |
|
|
|
constructor() { |
|
this.init(); |
|
} |
|
|
|
init() { |
|
this.info = { ...defaultConfig, ...projectConfig, ...viteEnv }; |
|
} |
|
|
|
getConfig() { |
|
return this.info; |
|
} |
|
}
|
|
|