mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 00:23:51 +08:00
add:登录、注册、首页、忘记密码页的多语言logo显示判断
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<!-- 左侧元素 -->
|
<!-- 左侧元素 -->
|
||||||
<div class="header-left" @click="goHome">
|
<div class="header-left" @click="goHome">
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" class="logo-img" />
|
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" class="logo-img" />
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" class="brand-img" />
|
<img loading="lazy" alt="" :src="xiaozhiAiIcon" class="brand-img" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 中间导航菜单 -->
|
<!-- 中间导航菜单 -->
|
||||||
@@ -257,6 +257,24 @@ export default {
|
|||||||
return this.$t("language.zhCN");
|
return this.$t("language.zhCN");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 根据当前语言获取对应的xiaozhi-ai图标
|
||||||
|
xiaozhiAiIcon() {
|
||||||
|
const currentLang = this.currentLanguage;
|
||||||
|
switch (currentLang) {
|
||||||
|
case "zh_CN":
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_CN.png");
|
||||||
|
case "zh_TW":
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_TW.png");
|
||||||
|
case "en":
|
||||||
|
return require("@/assets/xiaozhi-ai_en.png");
|
||||||
|
case "de":
|
||||||
|
return require("@/assets/xiaozhi-ai_de.png");
|
||||||
|
case "vi":
|
||||||
|
return require("@/assets/xiaozhi-ai_vi.png");
|
||||||
|
default:
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_CN.png");
|
||||||
|
}
|
||||||
|
},
|
||||||
// 用户菜单选项
|
// 用户菜单选项
|
||||||
userMenuOptions() {
|
userMenuOptions() {
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
">
|
">
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" style="width: 45px; height: 45px" />
|
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" style="width: 45px; height: 45px" />
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px" />
|
<img loading="lazy" alt="" :src="xiaozhiAiIcon" style="height: 18px" />
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<div class="login-person">
|
<div class="login-person">
|
||||||
@@ -192,6 +192,24 @@ export default {
|
|||||||
return this.$t("language.zhCN");
|
return this.$t("language.zhCN");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 根据当前语言获取对应的xiaozhi-ai图标
|
||||||
|
xiaozhiAiIcon() {
|
||||||
|
const currentLang = this.currentLanguage;
|
||||||
|
switch (currentLang) {
|
||||||
|
case "zh_CN":
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_CN.png");
|
||||||
|
case "zh_TW":
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_TW.png");
|
||||||
|
case "en":
|
||||||
|
return require("@/assets/xiaozhi-ai_en.png");
|
||||||
|
case "de":
|
||||||
|
return require("@/assets/xiaozhi-ai_de.png");
|
||||||
|
case "vi":
|
||||||
|
return require("@/assets/xiaozhi-ai_vi.png");
|
||||||
|
default:
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_CN.png");
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<el-header>
|
<el-header>
|
||||||
<div style="display: flex;align-items: center;margin-top: 15px;margin-left: 10px;gap: 10px;">
|
<div style="display: flex;align-items: center;margin-top: 15px;margin-left: 10px;gap: 10px;">
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" style="width: 45px;height: 45px;" />
|
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" style="width: 45px;height: 45px;" />
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px;" />
|
<img loading="lazy" alt="" :src="xiaozhiAiIcon" style="height: 18px;" />
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<div class="login-person">
|
<div class="login-person">
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
<div style="font-size: 14px;color: #979db1;">
|
<div style="font-size: 14px;color: #979db1;">
|
||||||
{{ $t('register.agreeTo') }}
|
{{ $t('register.agreeTo') }}
|
||||||
<div style="display: inline-block;color: #5778FF;cursor: pointer;">{{ $t('register.userAgreement') }}</div>
|
<div style="display: inline-block;color: #5778FF;cursor: pointer;">{{ $t('register.userAgreement') }}</div>
|
||||||
{{ $t('register.and') }}
|
{{ $t('login.and') }}
|
||||||
<div style="display: inline-block;color: #5778FF;cursor: pointer;">{{ $t('register.privacyPolicy') }}</div>
|
<div style="display: inline-block;color: #5778FF;cursor: pointer;">{{ $t('register.privacyPolicy') }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,6 +127,7 @@ import Api from '@/apis/api';
|
|||||||
import VersionFooter from '@/components/VersionFooter.vue';
|
import VersionFooter from '@/components/VersionFooter.vue';
|
||||||
import { getUUID, goToPage, showDanger, showSuccess, sm2Encrypt, validateMobile } from '@/utils';
|
import { getUUID, goToPage, showDanger, showSuccess, sm2Encrypt, validateMobile } from '@/utils';
|
||||||
import { mapState } from 'vuex';
|
import { mapState } from 'vuex';
|
||||||
|
import i18n from '@/i18n';
|
||||||
|
|
||||||
// 导入语言切换功能
|
// 导入语言切换功能
|
||||||
|
|
||||||
@@ -142,6 +143,28 @@ export default {
|
|||||||
mobileAreaList: state => state.pubConfig.mobileAreaList,
|
mobileAreaList: state => state.pubConfig.mobileAreaList,
|
||||||
sm2PublicKey: state => state.pubConfig.sm2PublicKey,
|
sm2PublicKey: state => state.pubConfig.sm2PublicKey,
|
||||||
}),
|
}),
|
||||||
|
// 获取当前语言
|
||||||
|
currentLanguage() {
|
||||||
|
return i18n.locale || "zh_CN";
|
||||||
|
},
|
||||||
|
// 根据当前语言获取对应的xiaozhi-ai图标
|
||||||
|
xiaozhiAiIcon() {
|
||||||
|
const currentLang = this.currentLanguage;
|
||||||
|
switch (currentLang) {
|
||||||
|
case "zh_CN":
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_CN.png");
|
||||||
|
case "zh_TW":
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_TW.png");
|
||||||
|
case "en":
|
||||||
|
return require("@/assets/xiaozhi-ai_en.png");
|
||||||
|
case "de":
|
||||||
|
return require("@/assets/xiaozhi-ai_de.png");
|
||||||
|
case "vi":
|
||||||
|
return require("@/assets/xiaozhi-ai_vi.png");
|
||||||
|
default:
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_CN.png");
|
||||||
|
}
|
||||||
|
},
|
||||||
canSendMobileCaptcha() {
|
canSendMobileCaptcha() {
|
||||||
return this.countdown === 0 && validateMobile(this.form.mobile, this.form.areaCode);
|
return this.countdown === 0 && validateMobile(this.form.mobile, this.form.areaCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<el-header>
|
<el-header>
|
||||||
<div style="display: flex;align-items: center;margin-top: 15px;margin-left: 10px;gap: 10px;">
|
<div style="display: flex;align-items: center;margin-top: 15px;margin-left: 10px;gap: 10px;">
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" style="width: 45px;height: 45px;" />
|
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" style="width: 45px;height: 45px;" />
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" style="height: 18px;" />
|
<img loading="lazy" alt="" :src="xiaozhiAiIcon" style="height: 18px;" />
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<div class="login-person">
|
<div class="login-person">
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<div style="font-size: 14px;color: #979db1;">
|
<div style="font-size: 14px;color: #979db1;">
|
||||||
{{ $t('retrievePassword.agreeTo') }}
|
{{ $t('retrievePassword.agreeTo') }}
|
||||||
<div style="display: inline-block;color: #5778FF;cursor: pointer;">{{ $t('register.userAgreement') }}</div>
|
<div style="display: inline-block;color: #5778FF;cursor: pointer;">{{ $t('register.userAgreement') }}</div>
|
||||||
{{ $t('register.and') }}
|
{{ $t('login.and') }}
|
||||||
<div style="display: inline-block;color: #5778FF;cursor: pointer;">{{ $t('register.privacyPolicy') }}</div>
|
<div style="display: inline-block;color: #5778FF;cursor: pointer;">{{ $t('register.privacyPolicy') }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -103,6 +103,7 @@ import Api from '@/apis/api';
|
|||||||
import VersionFooter from '@/components/VersionFooter.vue';
|
import VersionFooter from '@/components/VersionFooter.vue';
|
||||||
import { getUUID, goToPage, showDanger, showSuccess, validateMobile, sm2Encrypt } from '@/utils';
|
import { getUUID, goToPage, showDanger, showSuccess, validateMobile, sm2Encrypt } from '@/utils';
|
||||||
import { mapState } from 'vuex';
|
import { mapState } from 'vuex';
|
||||||
|
import i18n from '@/i18n';
|
||||||
|
|
||||||
// 导入语言切换功能
|
// 导入语言切换功能
|
||||||
import { changeLanguage } from '@/i18n';
|
import { changeLanguage } from '@/i18n';
|
||||||
@@ -118,6 +119,28 @@ export default {
|
|||||||
mobileAreaList: state => state.pubConfig.mobileAreaList,
|
mobileAreaList: state => state.pubConfig.mobileAreaList,
|
||||||
sm2PublicKey: state => state.pubConfig.sm2PublicKey
|
sm2PublicKey: state => state.pubConfig.sm2PublicKey
|
||||||
}),
|
}),
|
||||||
|
// 获取当前语言
|
||||||
|
currentLanguage() {
|
||||||
|
return i18n.locale || "zh_CN";
|
||||||
|
},
|
||||||
|
// 根据当前语言获取对应的xiaozhi-ai图标
|
||||||
|
xiaozhiAiIcon() {
|
||||||
|
const currentLang = this.currentLanguage;
|
||||||
|
switch (currentLang) {
|
||||||
|
case "zh_CN":
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_CN.png");
|
||||||
|
case "zh_TW":
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_TW.png");
|
||||||
|
case "en":
|
||||||
|
return require("@/assets/xiaozhi-ai_en.png");
|
||||||
|
case "de":
|
||||||
|
return require("@/assets/xiaozhi-ai_de.png");
|
||||||
|
case "vi":
|
||||||
|
return require("@/assets/xiaozhi-ai_vi.png");
|
||||||
|
default:
|
||||||
|
return require("@/assets/xiaozhi-ai_zh_CN.png");
|
||||||
|
}
|
||||||
|
},
|
||||||
canSendMobileCaptcha() {
|
canSendMobileCaptcha() {
|
||||||
return this.countdown === 0 && validateMobile(this.form.mobile, this.form.areaCode);
|
return this.countdown === 0 && validateMobile(this.form.mobile, this.form.areaCode);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user