refactor(lang): 优化多语言翻译函数,支持传入默认值

修改lang.js的翻译方法,支持传入默认值参数,当找不到对应翻译时使用传入的默认值;同时更新member-public.js中的调用方式,简化多语言调用代码
This commit is contained in:
2026-06-16 18:03:52 +08:00
parent e9ee61f509
commit c2b38476ea
2 changed files with 12 additions and 4 deletions

View File

@@ -12,8 +12,8 @@ export default {
// 退出登录
logout() {
uni.showModal({
title: this.$lang ? this.$lang('logoutTitle') : '提示',
content: this.$lang ? this.$lang('logoutContent') : '确定要退出登录吗',
title: this.$lang('logoutTitle', '提示'),
content: this.$lang('logoutContent', '确定要退出登录吗'),
success: (res) => {
if (res.confirm) {
this.clearLoginState();