!311 修复DocAlert无法配置是否启用的问题

Merge pull request !311 from dhb52/master
pull/375/MERGE
芋道源码 2024-02-17 03:45:58 +00:00 committed by Gitee
commit a451c0b7c8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 9 additions and 5 deletions

3
.env
View File

@ -13,5 +13,8 @@ VITE_APP_TENANT_ENABLE=true
# 验证码的开关 # 验证码的开关
VITE_APP_CAPTCHA_ENABLE=true VITE_APP_CAPTCHA_ENABLE=true
# 文档地址的开关
VITE_APP_DOCALERT_ENABLE=false
# 百度统计 # 百度统计
VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc

View File

@ -22,7 +22,7 @@ const goToUrl = () => {
/** 是否开启 */ /** 是否开启 */
const getEnable = () => { const getEnable = () => {
return import.meta.env.VITE_APP_TENANT_ENABLE === 'true' return import.meta.env.VITE_APP_DOCALERT_ENABLE !== 'false'
} }
</script> </script>
<style scoped> <style scoped>

View File

@ -193,8 +193,8 @@ const LoginRules = {
} }
const loginData = reactive({ const loginData = reactive({
isShowPassword: false, isShowPassword: false,
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE, captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE !== 'false',
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE, tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE !== 'false',
loginForm: { loginForm: {
tenantName: '芋道源码', tenantName: '芋道源码',
username: 'admin', username: 'admin',
@ -207,7 +207,7 @@ const loginData = reactive({
// //
const getCode = async () => { const getCode = async () => {
// //
if (loginData.captchaEnable === 'false') { if (loginData.captchaEnable) {
await handleLogin({}) await handleLogin({})
} else { } else {
// //
@ -217,7 +217,7 @@ const getCode = async () => {
} }
//ID //ID
const getTenantId = async () => { const getTenantId = async () => {
if (loginData.tenantEnable === 'true') { if (loginData.tenantEnable) {
const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName) const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName)
authUtil.setTenantId(res) authUtil.setTenantId(res)
} }

1
types/env.d.ts vendored
View File

@ -14,6 +14,7 @@ interface ImportMetaEnv {
readonly VITE_DEV: string readonly VITE_DEV: string
readonly VITE_APP_CAPTCHA_ENABLE: string readonly VITE_APP_CAPTCHA_ENABLE: string
readonly VITE_APP_TENANT_ENABLE: string readonly VITE_APP_TENANT_ENABLE: string
readonly VITE_APP_DOCALERT_ENABLE: string
readonly VITE_BASE_URL: string readonly VITE_BASE_URL: string
readonly VITE_UPLOAD_URL: string readonly VITE_UPLOAD_URL: string
readonly VITE_API_BASEPATH: string readonly VITE_API_BASEPATH: string