Files
aiinvite2/wechat-miniprogram/pages/login/index.wxml
T
kenyang 1636418f06 fix(otp): 验证码7位反馈双保险——邮件模板括号隔离 + 前端输入清洗
用户反馈(smartgz@qq.com):验证码收到 7 位、前台只能填 6 位。
排查:OTP 生成 randomInt(100000,999999) 恒 6 位;真因=邮件正文「5 分钟」等
相邻数字被用户一并阅读/输入(或 QQ 邮箱 base64 折行渲染粘连观感)。

双保险:
- 邮件模板:验证码独立成行加【 】括号醒目隔离,明示「输入方括号内 6 位数字」
- 小程序双输入框(登录页+资料页):maxlength 6→8 放宽;提交时提取纯数字取前 6 位,
  非 6 位给明确指引文案;登录/绑定两处 post 均改用清洗后 cleanCode

冒烟:新模板 mock SMTP 截码【 851639 】渲染正常;凭码登录成功;
污染输入(前置粘连数字)服务端拒、纯 6 位重试通过。
2026-11-24 13:54:22 +08:00

83 lines
2.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<view class="login-page">
<!-- 返回按钮 -->
<view class="nav-back" bindtap="goBack">
<text class="back-icon">‹</text>
</view>
<view class="login-header">
<image class="login-logo" src="/assets/images/logo.svg" mode="aspectFit" />
<text class="login-title">拆约</text>
<text class="login-subtitle">拆书活动邀约平台</text>
</view>
<view class="login-content">
<view class="login-desc">
<text>登录后可以创建和参加活动</text>
<text>遇见更多拆为己用的拆书家</text>
</view>
<!-- 手机号一键登录(主推:运营商授权手机号,一键完成) -->
<view class="phone-section">
<button
class="phone-login-btn"
open-type="getPhoneNumber"
bindgetphonenumber="handlePhoneLogin"
loading="{{phoneLoading}}"
>
<text class="phone-btn-text">{{phoneLoading ? '登录中...' : '手机号一键登录'}}</text>
</button>
<view class="phone-tip">
<text>使用本机手机号快速登录,未注册将自动创建账号</text>
</view>
<view class="divider">
<view class="divider-line"></view>
<text class="divider-text">其他登录方式</text>
<view class="divider-line"></view>
</view>
</view>
<!-- 邮箱验证码登录(次选:开放所有用户,未注册邮箱自动创建账号) -->
<view class="email-form">
<view class="email-row">
<input
class="email-input"
type="text"
value="{{email}}"
placeholder="请输入邮箱"
placeholder-class="identifier-placeholder"
bindinput="onEmailInput"
confirm-type="done"
/>
</view>
<view class="email-otp-row">
<input
class="email-otp-input"
type="number"
maxlength="8"
value="{{emailOtp}}"
placeholder="邮箱验证码"
placeholder-class="identifier-placeholder"
bindinput="onOtpInput"
bindconfirm="handleEmailLogin"
/>
<button
class="email-otp-btn"
bindtap="handleSendOtp"
disabled="{{otpSending || otpCountdown > 0}}"
>{{otpSending ? '发送中...' : (otpCountdown > 0 ? otpCountdown + 's' : '获取验证码')}}</button>
</view>
<button
class="email-login-btn"
bindtap="handleEmailLogin"
disabled="{{loading}}"
>
<text class="identifier-btn-text">{{loading ? '登录中...' : '登录'}}</text>
</button>
<view class="identifier-tip">
<text>未注册的邮箱将自动创建账号;邮箱是身份认定凭证,绑定后不可更改</text>
</view>
</view>
</view>
</view>