feat: 增加是否开启多语言切换参数
This commit is contained in:
parent
cc52c599dc
commit
6628ca5372
@ -116,6 +116,11 @@ public class ConfigConst
|
||||
/// </summary>
|
||||
public const string SysUpgrade = "sys_upgrade";
|
||||
|
||||
/// <summary>
|
||||
/// 开启多语言切换
|
||||
/// </summary>
|
||||
public const string SysI18NSwitch = "sys_i18n_switch";
|
||||
|
||||
/// <summary>
|
||||
/// 支付宝授权页面地址
|
||||
/// </summary>
|
||||
|
||||
@ -38,6 +38,7 @@ public class SysConfigSeedData : ISqlSugarEntitySeedData<SysConfig>
|
||||
new SysConfig{ Id=1300000000251, Name="密码时间有效期", Code=ConfigConst.SysPasswordExpirationTime, Value="0", SysFlag=YesNoEnum.Y, Remark="默认0表示永不过期,否则表示过期天数", OrderNo=200, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-17 00:00:00") },
|
||||
new SysConfig{ Id=1300000000261, Name="密码历史记录验证", Code=ConfigConst.SysPasswordRecord, Value="False", SysFlag=YesNoEnum.Y, Remark="是否验证历史密码禁止再次使用", OrderNo=210, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-17 00:00:00") },
|
||||
new SysConfig{ Id=1300000000271, Name="显示系统更新日志", Code=ConfigConst.SysUpgrade, Value="True", SysFlag=YesNoEnum.Y, Remark="是否显示系统更新日志", OrderNo=220, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-20 00:00:00") },
|
||||
new SysConfig{ Id=1300000000281, Name="开启多语言切换", Code=ConfigConst.SysI18NSwitch, Value="True", SysFlag=YesNoEnum.Y, Remark="是否显示多语言切换按钮", OrderNo=230, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-20 00:00:00") },
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -586,6 +586,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
|
||||
var forceChangePassword = await _sysConfigService.GetConfigValueByCode<bool>(ConfigConst.SysForceChangePassword); // 强制修改密码
|
||||
var passwordExpirationTime = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysPasswordExpirationTime); // 密码有效期
|
||||
var i18NSwitch = await _sysConfigService.GetConfigValueByCode<bool>(ConfigConst.SysI18NSwitch); // 开启多语言切换
|
||||
var publicKey = App.GetConfig<string>("Cryptogram:PublicKey", true); // 获取密码加解密公钥配置
|
||||
|
||||
return new
|
||||
@ -608,7 +609,8 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
ForceChangePassword = forceChangePassword,
|
||||
PasswordExpirationTime = passwordExpirationTime,
|
||||
PublicKey = publicKey,
|
||||
CarouselFiles = carouselFiles
|
||||
CarouselFiles = carouselFiles,
|
||||
I18NSwitch = i18NSwitch,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
|
||||
<el-dropdown v-if="themeConfig.i18NSwitch" :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
|
||||
<div class="layout-navbars-breadcrumb-user-icon">
|
||||
<FlagIcon :code="currentCountryCode" square :size="12" :title="$t('message.user.title1')" />
|
||||
</div>
|
||||
|
||||
@ -152,6 +152,8 @@ export const useThemeConfig = defineStore('themeConfig', {
|
||||
icp: '省ICP备12345678号',
|
||||
// Icp地址
|
||||
icpUrl: 'https://beian.miit.gov.cn',
|
||||
// 是否开启多语言切换
|
||||
i18NSwitch: true,
|
||||
},
|
||||
}),
|
||||
actions: {
|
||||
|
||||
11
Web/src/types/pinia.d.ts
vendored
11
Web/src/types/pinia.d.ts
vendored
@ -99,10 +99,11 @@ declare interface ThemeConfigState {
|
||||
logoUrl: string; // 系统 logo 地址
|
||||
icp: string; // Icp备案号
|
||||
icpUrl: string; // Icp地址
|
||||
version: string; // 版本号
|
||||
secondVer: boolean; // 是否开启二级验证
|
||||
captcha: boolean; // 是否开启验证码
|
||||
forceChangePassword: boolean; // 是否开启强制修改密码
|
||||
passwordExpirationTime: number; // 是否验证密码有效期
|
||||
version?: string; // 版本号
|
||||
secondVer?: boolean; // 是否开启二级验证
|
||||
captcha?: boolean; // 是否开启验证码
|
||||
forceChangePassword?: boolean; // 是否开启强制修改密码
|
||||
passwordExpirationTime?: number; // 是否验证密码有效期
|
||||
i18NSwitch: boolean; // 是否开启多语言切换
|
||||
};
|
||||
}
|
||||
|
||||
@ -54,6 +54,8 @@ export async function loadSysInfo(tenantid: number) {
|
||||
themeConfig.value.forceChangePassword = data.forceChangePassword;
|
||||
// 是否验证密码有效期
|
||||
themeConfig.value.passwordExpirationTime = data.passwordExpirationTime;
|
||||
// 开启多语言切换
|
||||
themeConfig.value.i18NSwitch = data.i18NSwitch;
|
||||
// 密码加解密公匙
|
||||
window.__env__.VITE_SM_PUBLIC_KEY = data.publicKey;
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="change-language">
|
||||
<div v-if="getThemeConfig.i18NSwitch" class="change-language">
|
||||
<!-- <div class="change-language-title">{{ $t('message.account.changeLanguage') }}:</div> -->
|
||||
<div style="cursor: pointer">
|
||||
<el-dropdown @command="onLanguageChange">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user