From 1a48301cee27a9e81b3086ea6bd69c7b61aa9e0b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 4 Sep 2022 12:18:12 +0800 Subject: [PATCH] =?UTF-8?q?vue2=20=E9=AA=8C=E8=AF=81=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E5=85=B3=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AF=B9=E7=A4=BE=E4=BA=A4=E7=99=BB=E5=BD=95=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin/.env.demo1024 | 3 ++ yudao-ui-admin/.env.dev | 3 ++ yudao-ui-admin/.env.local | 3 ++ yudao-ui-admin/.env.prod | 3 ++ yudao-ui-admin/.env.stage | 3 ++ yudao-ui-admin/src/utils/ruoyi.js | 13 ++++++ yudao-ui-admin/src/views/login.vue | 24 +++++++----- yudao-ui-admin/src/views/socialLogin.vue | 50 +++++++++++------------- 8 files changed, 65 insertions(+), 37 deletions(-) diff --git a/yudao-ui-admin/.env.demo1024 b/yudao-ui-admin/.env.demo1024 index 93ee78843..18efd38d3 100644 --- a/yudao-ui-admin/.env.demo1024 +++ b/yudao-ui-admin/.env.demo1024 @@ -17,6 +17,9 @@ VUE_APP_APP_NAME ='/admin-ui/' # 多租户的开关 VUE_APP_TENANT_ENABLE = true +# 验证码的开关 +VUE_APP_CAPTCHA_ENABLE = true + # 文档的开关 VUE_APP_DOC_ENABLE = true diff --git a/yudao-ui-admin/.env.dev b/yudao-ui-admin/.env.dev index db9e33854..cbe967efd 100644 --- a/yudao-ui-admin/.env.dev +++ b/yudao-ui-admin/.env.dev @@ -13,6 +13,9 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true # 多租户的开关 VUE_APP_TENANT_ENABLE = true +# 验证码的开关 +VUE_APP_CAPTCHA_ENABLE = true + # 文档的开关 VUE_APP_DOC_ENABLE = true diff --git a/yudao-ui-admin/.env.local b/yudao-ui-admin/.env.local index 58029b662..9b294e2b7 100644 --- a/yudao-ui-admin/.env.local +++ b/yudao-ui-admin/.env.local @@ -14,6 +14,9 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true # 多租户的开关 VUE_APP_TENANT_ENABLE = true +# 验证码的开关 +VUE_APP_CAPTCHA_ENABLE = true + # 文档的开关 VUE_APP_DOC_ENABLE = true diff --git a/yudao-ui-admin/.env.prod b/yudao-ui-admin/.env.prod index 5deaf75fc..a1415ed39 100644 --- a/yudao-ui-admin/.env.prod +++ b/yudao-ui-admin/.env.prod @@ -15,6 +15,9 @@ VUE_APP_APP_NAME ='yudao-admin' # 多租户的开关 VUE_APP_TENANT_ENABLE = true +# 验证码的开关 +VUE_APP_CAPTCHA_ENABLE = true + # 文档的开关 VUE_APP_DOC_ENABLE = false diff --git a/yudao-ui-admin/.env.stage b/yudao-ui-admin/.env.stage index 7526f2680..5942b3c6d 100644 --- a/yudao-ui-admin/.env.stage +++ b/yudao-ui-admin/.env.stage @@ -15,6 +15,9 @@ PUBLIC_PATH = 'http://static.yudao.iocoder.cn/' # 多租户的开关 VUE_APP_TENANT_ENABLE = true +# 验证码的开关 +VUE_APP_CAPTCHA_ENABLE = true + # 文档的开关 VUE_APP_DOC_ENABLE = false diff --git a/yudao-ui-admin/src/utils/ruoyi.js b/yudao-ui-admin/src/utils/ruoyi.js index 7096e1fdc..a05266d67 100644 --- a/yudao-ui-admin/src/utils/ruoyi.js +++ b/yudao-ui-admin/src/utils/ruoyi.js @@ -185,6 +185,19 @@ export function getTenantEnable() { return process.env.VUE_APP_TENANT_ENABLE || true; } +/** + * 获得验证码功能是否开启 + */ +export function getCaptchaEnable() { + if (process.env.VUE_APP_CAPTCHA_ENABLE === "true") { + return true; + } + if (process.env.VUE_APP_CAPTCHA_ENABLE === "false") { + return false; + } + return process.env.VUE_APP_CAPTCHA_ENABLE || true; +} + /** * 获得文档是否开启 */ diff --git a/yudao-ui-admin/src/views/login.vue b/yudao-ui-admin/src/views/login.vue index 6e8578b0f..1024577b6 100644 --- a/yudao-ui-admin/src/views/login.vue +++ b/yudao-ui-admin/src/views/login.vue @@ -87,12 +87,11 @@ - + + + + + + + +