Преглед на файлове

fix: 登录合规整改 - 跳过登录入口、静默授权、协议措辞

- login.vue: 去除 getPhoneNumber 强制索号,改为静默 wx.login;添加「暂不登录」跳过按钮
- parent-index.vue: 移除 mounted 中强制跳转登录页的逻辑
- agreement.vue: 修改第2.1条「授权登录即视为注册」措辞
- 验证商品/活动/文章详情页无需登录可访问(后端公开路径已配置)
asus преди 1 месец
родител
ревизия
ddc327c563
променени са 3 файла, в които са добавени 28 реда и са изтрити 18 реда
  1. 3 5
      cfc-frontend/pages/home-pages/parent-index.vue
  2. 24 12
      cfc-frontend/pages/login/login.vue
  3. 1 1
      cfc-frontend/pages/policy/agreement.vue

+ 3 - 5
cfc-frontend/pages/home-pages/parent-index.vue

@@ -582,12 +582,10 @@ export default {
   // 使用 mounted 而非 onLoad,因为本组件作为条件渲染子组件(v-if),
   // page 生命周期钩子(onLoad/onShow)可能在组件挂载前已触发完毕
   mounted() {
-    if (!uni.getStorageSync('token')) {
-      uni.reLaunch({ url: '/pages/login/login' })
-      return
+    if (uni.getStorageSync('token')) {
+      this.isLoggedIn = true
+      this.loadData()
     }
-    this.isLoggedIn = true
-    this.loadData()
   },
   onShow() {
     // 首次 onShow 紧接 mounted 之后,跳过避免双重加载

+ 24 - 12
cfc-frontend/pages/login/login.vue

@@ -31,13 +31,17 @@
         <button
           class="phone-btn"
           :loading="loading"
-          open-type="getPhoneNumber"
-          @getphonenumber="onGetPhoneNumber"
+          @click="handleWechatLogin"
         >
           <text>手机号快捷登录</text>
         </button>
       </view>
 
+      <!-- 暂不登录 -->
+      <view class="skip-section">
+        <text class="skip-btn" @click="handleSkipLogin">暂不登录,先逛逛</text>
+      </view>
+
       <view class="agreement">
         <checkbox-group @change="onAgreementChange">
           <label>
@@ -63,7 +67,6 @@ export default {
       agreed: false,
       nickname: '',
       avatar: '',
-      phoneCode: '',
       redirectUrl: ''
     }
   },
@@ -95,12 +98,9 @@ export default {
         url: '/pages/policy/privacy'
       })
     },
-    onGetPhoneNumber(e) {
-      if (e.detail && e.detail.code) {
-        this.phoneCode = e.detail.code
-      }
-      // 无论是否授权手机号,都执行微信登录
-      this.handleWechatLogin()
+    handleSkipLogin() {
+      // 不登录直接进入首页
+      uni.switchTab({ url: '/pages/index-home/index' })
     },
     handleWechatLogin() {
       if (!this.agreed) {
@@ -125,12 +125,11 @@ export default {
           fail: function() { reject(new Error('微信登录失败')) }
         })
       })]).then(function(loginRes) {
-        var phoneCodeToSend = self.phoneCode
-        self.phoneCode = '' // 使用后清空
+        // 静默登录:仅获取 openid,不强制索取手机号
         wechatLogin(loginRes.code, {
           nickname: self.nickname || '用户',
           avatar: self.avatar || ''
-        }, phoneCodeToSend).then(function(res) {
+        }, '').then(function(res) {
           // 保存 token 和用户信息(只写一次)
           uni.setStorageSync('token', res.data.token)
           uni.setStorageSync('userId', res.data.userId)
@@ -398,6 +397,19 @@ export default {
   font-size: 32rpx;
 }
 
+/* ===== 跳过登录 ===== */
+.skip-section {
+  text-align: center;
+  margin-bottom: 20rpx;
+}
+
+.skip-btn {
+  font-size: 28rpx;
+  color: #999;
+  text-decoration: underline;
+  padding: 16rpx 0;
+}
+
 .agreement {
   margin-top: 16rpx;
   text-align: center;

+ 1 - 1
cfc-frontend/pages/policy/agreement.vue

@@ -17,7 +17,7 @@
       <view class="policy-section">
         <text class="section-title">二、账号注册与管理</text>
         <text class="section-text">
-          2.1 您通过微信账号授权登录本平台,授权登录即视为您注册本平台账号。
+          2.1 您通过微信账号授权登录本平台,即完成账号注册。在您主动点击"登录"按钮并完成授权后,我们将为您创建本平台账号。
         </text>
         <text class="section-text">
           2.2 您应妥善保管您的账号信息,因您保管不当导致的账号被盗用、信息泄露等损失由您自行承担。