From d4b44c042dddd4fb0399d4c7b5e66f2441eba1cf Mon Sep 17 00:00:00 2001 From: sc Date: Thu, 16 Jun 2022 08:44:32 +0800 Subject: [PATCH] =?UTF-8?q?ADD=20myConfig=20=E4=B8=9A=E5=8A=A1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/index.js | 6 +++++- src/config/myConfig.js | 10 ++++++++++ src/views/login/index.vue | 10 ++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 src/config/myConfig.js diff --git a/src/config/index.js b/src/config/index.js index bae863e3..1648fb22 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -67,10 +67,14 @@ const DEFAULT_CONFIG = { } } +//合并业务配置 +import MY_CONFIG from "./myConfig" +Object.assign(DEFAULT_CONFIG, MY_CONFIG) + // 如果生产模式,就合并动态的APP_CONFIG // public/config.js if(process.env.NODE_ENV === 'production'){ Object.assign(DEFAULT_CONFIG, APP_CONFIG) } -module.exports = DEFAULT_CONFIG +export default DEFAULT_CONFIG diff --git a/src/config/myConfig.js b/src/config/myConfig.js new file mode 100644 index 00000000..e87699d6 --- /dev/null +++ b/src/config/myConfig.js @@ -0,0 +1,10 @@ +//业务配置 +//会合并至this.$CONFIG +//生产模式 public/config.js 同名key会覆盖这里的配置从而实现打包后的热更新 +//为避免和SCUI框架配置混淆建议添加前缀 MY_ +//全局可使用 this.$CONFIG.MY_KEY 访问 + +export default { + //是否显示第三方授权登录 + MY_SHOW_LOGIN_OAUTH: true +} diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 4c7947d5..9ae30177 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -51,10 +51,12 @@ - {{ $t('login.signInOther') }} -
- -
+