fix: privacy policy compliance - checkbox must be manually checked, add WeChat privacy API
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+28
-1
@@ -1,7 +1,34 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
onLaunch(() => { console.log('职引 App launched') })
|
onLaunch(() => {
|
||||||
|
console.log('职引 App launched')
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
initPrivacy()
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
function initPrivacy() {
|
||||||
|
if (wx.onNeedPrivacyAuthorization) {
|
||||||
|
wx.onNeedPrivacyAuthorization((resolve) => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '隐私政策授权',
|
||||||
|
content: '请仔细阅读并同意《用户服务协议》和《隐私政策》后再使用本应用。您的个人信息将仅用于求职服务。',
|
||||||
|
confirmText: '同意',
|
||||||
|
cancelText: '拒绝',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
resolve({ event: 'agree' })
|
||||||
|
} else {
|
||||||
|
resolve({ event: 'disagree' })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
onShow(() => { console.log('职引 App shown') })
|
onShow(() => { console.log('职引 App shown') })
|
||||||
onHide(() => { console.log('职引 App hidden') })
|
onHide(() => { console.log('职引 App hidden') })
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
"appid": "wxf466b3c3bc411ffc",
|
"appid": "wxf466b3c3bc411ffc",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false
|
"urlCheck": false,
|
||||||
|
"__usePrivacyCheck__": true
|
||||||
},
|
},
|
||||||
"usingComponents": true
|
"usingComponents": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<text class="field-label">密码</text>
|
<text class="field-label">密码</text>
|
||||||
<input class="input" type="password" v-model="password" placeholder="请输入密码" @confirm="doPasswordLogin" />
|
<input class="input" type="password" v-model="password" placeholder="请输入密码" @confirm="doPasswordLogin" />
|
||||||
</view>
|
</view>
|
||||||
<button class="login-btn" :disabled="!canPasswordLogin || pwdLoading" @click="doPasswordLogin">
|
<button class="login-btn" :disabled="!canPasswordLogin || pwdLoading || !agreed" @click="doPasswordLogin">
|
||||||
{{ pwdLoading ? '登录中...' : '登录' }}
|
{{ pwdLoading ? '登录中...' : '登录' }}
|
||||||
</button>
|
</button>
|
||||||
<view class="switch-hint" @click="loginMode='code'">忘记密码?使用验证码登录</view>
|
<view class="switch-hint" @click="loginMode='code'">忘记密码?使用验证码登录</view>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<text class="field-label">验证码</text>
|
<text class="field-label">验证码</text>
|
||||||
<input class="input" type="number" maxlength="6" v-model="emailCode" placeholder="请输入6位验证码" />
|
<input class="input" type="number" maxlength="6" v-model="emailCode" placeholder="请输入6位验证码" />
|
||||||
</view>
|
</view>
|
||||||
<button class="login-btn" :disabled="!emailSent || !emailCode || emailLoading" @click="doEmailLogin">
|
<button class="login-btn" :disabled="!emailSent || !emailCode || emailLoading || !agreed" @click="doEmailLogin">
|
||||||
{{ emailLoading ? '登录中...' : '登录' }}
|
{{ emailLoading ? '登录中...' : '登录' }}
|
||||||
</button>
|
</button>
|
||||||
<view class="switch-hint" @click="loginMode='password'">已有密码?使用密码登录</view>
|
<view class="switch-hint" @click="loginMode='password'">已有密码?使用密码登录</view>
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<text class="field-label">确认密码</text>
|
<text class="field-label">确认密码</text>
|
||||||
<input class="input" type="password" v-model="confirmPassword" placeholder="再次输入密码" @confirm="doRegister" />
|
<input class="input" type="password" v-model="confirmPassword" placeholder="再次输入密码" @confirm="doRegister" />
|
||||||
</view>
|
</view>
|
||||||
<button class="login-btn" :disabled="!canRegister || regLoading" @click="doRegister">
|
<button class="login-btn" :disabled="!canRegister || regLoading || !agreed" @click="doRegister">
|
||||||
{{ regLoading ? '注册中...' : '注册' }}
|
{{ regLoading ? '注册中...' : '注册' }}
|
||||||
</button>
|
</button>
|
||||||
<view class="switch-hint" @click="mainTab='login'">已有账号?去登录</view>
|
<view class="switch-hint" @click="mainTab='login'">已有账号?去登录</view>
|
||||||
@@ -87,15 +87,18 @@
|
|||||||
<view class="card" v-if="mainTab === 'wechat' && isMp">
|
<view class="card" v-if="mainTab === 'wechat' && isMp">
|
||||||
<text class="card-title">微信一键登录</text>
|
<text class="card-title">微信一键登录</text>
|
||||||
<text class="card-sub">授权后自动创建账号</text>
|
<text class="card-sub">授权后自动创建账号</text>
|
||||||
<button class="login-btn wx-btn" @click="doWxLogin">{{ wxLoading ? '登录中...' : '微信一键登录' }}</button>
|
<button class="login-btn wx-btn" :disabled="wxLoading || !agreed" @click="doWxLogin">{{ wxLoading ? '登录中...' : '微信一键登录' }}</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 法律声明 -->
|
<!-- 法律声明 - 用户自主勾选同意 -->
|
||||||
<view class="legal">
|
<view class="legal">
|
||||||
<text class="legal-text">登录即表示同意</text>
|
<label class="agree-label">
|
||||||
<text class="legal-link" @click="goAgreement">《用户协议》</text>
|
<checkbox :checked="agreed" @tap="agreed = !agreed" color="#4F46E5" style="transform:scale(0.85)" />
|
||||||
<text class="legal-text">和</text>
|
<text class="agree-text">我已阅读并同意</text>
|
||||||
<text class="legal-link" @click="goPrivacy">《隐私政策》</text>
|
<text class="legal-link" @tap.stop="goAgreement">《用户服务协议》</text>
|
||||||
|
<text class="agree-text">和</text>
|
||||||
|
<text class="legal-link" @tap.stop="goPrivacy">《隐私政策》</text>
|
||||||
|
</label>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -117,6 +120,8 @@
|
|||||||
import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
|
import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
|
||||||
import { api } from '../../config'
|
import { api } from '../../config'
|
||||||
|
|
||||||
|
const agreed = ref(false)
|
||||||
|
|
||||||
const mainTab = ref('login')
|
const mainTab = ref('login')
|
||||||
const loginMode = ref('password') // 'password' | 'code'
|
const loginMode = ref('password') // 'password' | 'code'
|
||||||
const isMp = ref(false)
|
const isMp = ref(false)
|
||||||
@@ -357,8 +362,9 @@ const goPrivacy = () => uni.navigateTo({ url: '/pages/privacy/privacy' })
|
|||||||
.switch-hint { text-align: center; font-size: 22rpx; color: var(--color-primary); padding: 20rpx 0 4rpx; }
|
.switch-hint { text-align: center; font-size: 22rpx; color: var(--color-primary); padding: 20rpx 0 4rpx; }
|
||||||
|
|
||||||
/* ===== Legal ===== */
|
/* ===== Legal ===== */
|
||||||
.legal { display: flex; justify-content: center; align-items: center; gap: 4rpx; margin-top: 24rpx; flex-wrap: wrap; }
|
.legal { display: flex; justify-content: center; align-items: center; margin-top: 24rpx; flex-wrap: wrap; }
|
||||||
.legal-text { font-size: 22rpx; color: var(--color-text-tertiary); }
|
.agree-label { display: flex; align-items: center; gap: 6rpx; flex-wrap: wrap; justify-content: center; }
|
||||||
|
.agree-text { font-size: 22rpx; color: var(--color-text-tertiary); }
|
||||||
.legal-link { font-size: 22rpx; color: var(--color-primary); }
|
.legal-link { font-size: 22rpx; color: var(--color-primary); }
|
||||||
|
|
||||||
/* ===== Password Modal ===== */
|
/* ===== Password Modal ===== */
|
||||||
|
|||||||
Reference in New Issue
Block a user