mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 04:03:56 +08:00
feat: mobile 添加用户协议和隐私政策
This commit is contained in:
@@ -14,7 +14,7 @@ import type { Language } from '@/store/lang'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { login } from '@/api/auth'
|
||||
// 导入国际化相关功能
|
||||
import { changeLanguage, getSupportedLanguages, initI18n, t } from '@/i18n'
|
||||
import { changeLanguage, getCurrentLanguage, getSupportedLanguages, initI18n, t } from '@/i18n'
|
||||
import { useConfigStore } from '@/store'
|
||||
// 导入SM2加密工具
|
||||
import { getEnvBaseUrl, sm2Encrypt } from '@/utils'
|
||||
@@ -117,6 +117,22 @@ function goToForgotPassword() {
|
||||
})
|
||||
}
|
||||
|
||||
// 跳转到用户协议
|
||||
function goToUserAgreement() {
|
||||
const lang = getCurrentLanguage() === 'zh_CN' ? 'zh' : 'en'
|
||||
uni.navigateTo({
|
||||
url: `/pages/login/user-agreement-${lang}`,
|
||||
})
|
||||
}
|
||||
|
||||
// 跳转到隐私政策
|
||||
function goToPrivacyPolicy() {
|
||||
const lang = getCurrentLanguage() === 'zh_CN' ? 'zh' : 'en'
|
||||
uni.navigateTo({
|
||||
url: `/pages/login/privacy-policy-${lang}`,
|
||||
})
|
||||
}
|
||||
|
||||
// 生成UUID
|
||||
function generateUUID() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
||||
@@ -387,6 +403,16 @@ onMounted(async () => {
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="policy-links">
|
||||
<text class="policy-link" @click="goToUserAgreement">
|
||||
{{ t('login.userAgreement') }}
|
||||
</text>
|
||||
<text class="policy-divider">|</text>
|
||||
<text class="policy-link" @click="goToPrivacyPolicy">
|
||||
{{ t('login.privacyPolicy') }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<!-- 登录方式切换 -->
|
||||
<view v-if="enableMobileLogin" class="login-type-switch">
|
||||
<view class="switch-tabs">
|
||||
@@ -681,6 +707,29 @@ onMounted(async () => {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.policy-links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.policy-link {
|
||||
color: #667eea;
|
||||
font-size: 26rpx;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.policy-divider {
|
||||
color: #999999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.forgot-password {
|
||||
.forgot-text {
|
||||
color: #667eea;
|
||||
|
||||
Reference in New Issue
Block a user