|
@@ -0,0 +1,24 @@
|
|
|
|
|
+import { APIHOST, IMGHOST } from '@/config'
|
|
|
|
|
+import extJson from '@/ext.json'
|
|
|
|
|
+
|
|
|
|
|
+const defaultExtConfig = {
|
|
|
|
|
+ ...(extJson.ext || {}),
|
|
|
|
|
+ apiHost: (extJson.ext && extJson.ext.apiHost) || APIHOST,
|
|
|
|
|
+ imgHost: (extJson.ext && extJson.ext.imgHost) || IMGHOST,
|
|
|
|
|
+ socketApiHost: (extJson.ext && extJson.ext.socketApiHost) || ''
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function getExtConfig() {
|
|
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
|
|
+ if (typeof wx !== 'undefined' && wx.getExtConfigSync) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...defaultExtConfig,
|
|
|
|
|
+ ...wx.getExtConfigSync()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // #endif
|
|
|
|
|
+
|
|
|
|
|
+ return defaultExtConfig
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export default getExtConfig()
|