From f2d6b029f124673185a612dac73e2aedd47345db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 13 Apr 2026 02:40:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(api-keys):=20=E4=BC=98=E5=8C=96=E9=9A=90?= =?UTF-8?q?=E7=A7=81=E5=8D=8F=E8=AE=AE=E5=90=8C=E6=84=8F=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=8F=8A=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正api-keys样式导入路径,改为developer路径 - 在开发者申请页面增加服务协议和隐私政策勾选框 - 提交时校验协议是否已勾选,未勾选时提示用户 - 优化申请页面协议区域样式及交互 - 在用户验证页面添加隐私政策同意勾选框 - 提交用户验证表单时检查协议同意状态 - 增加打开服务协议和隐私政策的链接跳转 - 更新项目配置,增加passport/webview路由配置 - 修复createTicket函数中日期格式正则表达式问题 --- project.private.config.json | 11 ++++- src/api/ticket.ts | 2 +- src/developer/developer/apply.tsx | 33 +++++++++++-- src/developer/project/[id]/api-keys.scss | 4 +- src/user/userVerify/index.tsx | 60 ++++++++++++++++++++---- 5 files changed, 93 insertions(+), 17 deletions(-) diff --git a/project.private.config.json b/project.private.config.json index 5b48130..cb01d35 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -4,12 +4,19 @@ "condition": { "miniprogram": { "list": [ + { + "name": "passport/webview/index", + "pathName": "passport/webview/index", + "query": "url=https%3A%2F%2Fwebsopy.websoft.top%2Fdeveloper", + "scene": null, + "launchMode": "default" + }, { "name": "passport/login", "pathName": "passport/login", "query": "", - "scene": null, - "launchMode": "default" + "launchMode": "default", + "scene": null }, { "name": "passport/invite/index", diff --git a/src/api/ticket.ts b/src/api/ticket.ts index 605eb22..66a955e 100644 --- a/src/api/ticket.ts +++ b/src/api/ticket.ts @@ -187,7 +187,7 @@ export async function listTicketReply(ticketId: string): Promise export async function createTicket(data: Partial): Promise { const newTicket: Ticket = { id: String(Date.now()), - ticketNo: `TK${new Date().toISOString().replace(/[-:T]/g, '').slice(0, 12)}`, + ticketNo: `TK${new Date().toISOString().replace(/[\-:T]/g, '').slice(0, 12)}`, title: data.title || '', content: data.content || '', type: data.type || 'technical', diff --git a/src/developer/developer/apply.tsx b/src/developer/developer/apply.tsx index a74acd6..3318c72 100644 --- a/src/developer/developer/apply.tsx +++ b/src/developer/developer/apply.tsx @@ -31,6 +31,7 @@ const DeveloperApplyPage: React.FC = () => { experience: '', }) const [submitting, setSubmitting] = useState(false) + const [agreementChecked, setAgreementChecked] = useState(false) // 加载申请记录 const loadData = async (pageNum: number = 1, isRefresh = false) => { @@ -77,6 +78,15 @@ const DeveloperApplyPage: React.FC = () => { return } + // 检查隐私协议是否同意 + if (!agreementChecked) { + Taro.showToast({ + title: '请先同意服务协议和隐私政策', + icon: 'none' + }); + return false; + } + setSubmitting(true) try { await createApply({ @@ -203,9 +213,26 @@ const DeveloperApplyPage: React.FC = () => { - - 点击提交即表示您同意《开发者协议》和《隐私政策》 - + + setAgreementChecked(!agreementChecked)} + > + {agreementChecked && } + + + 我已阅读并同意 + Taro.navigateTo({ url: '/passport/webview/index?url=' + encodeURIComponent('https://websopy.websoft.top/agreement') })}>《开发者协议》 + 和 + Taro.navigateTo({ url: '/passport/webview/index?url=' + encodeURIComponent('https://websopy.websoft.top/privacy') })}>《隐私政策》 + + + marginBottom: '16px', + fontSize: '12px' + }}> + setPrivacyAgreed(value)} + /> + + 我已阅读并同意 + openAgreement('service')}>《服务协议》 + 和 + openAgreement('privacy')}>《隐私政策》 + + +
+ +
) }