现在有的接口对接测试完成

This commit is contained in:
2026-07-25 19:19:36 +08:00
parent 8870136d1b
commit 817d85e117
59 changed files with 26623 additions and 1576 deletions
+13 -15
View File
@@ -15,15 +15,15 @@
'use strict';
var documentRef = root.document;
var CAPTCHA_SCENES = {
phone: 'PC_PHONE_CHANGE',
deactivate: 'PC_ACCOUNT_DEACTIVATE'
var CAPTCHA_OPERATIONS = {
phone: 'phone-change',
deactivate: 'account-deactivate'
};
var SMS_CODE_COOLDOWN_SECONDS = 60;
var boundPhone = '';
function getCaptchaScene(formType) {
return CAPTCHA_SCENES[formType] || '';
function getCaptchaOperation(formType) {
return CAPTCHA_OPERATIONS[formType] || '';
}
function hashPassword(value) {
@@ -100,18 +100,18 @@
}
async function ensureCaptcha(form, formType, subject) {
// 发送敏感业务短信前,先取得与当前场景绑定的验证码票据。
// 发送敏感业务短信前,先取得与当前认证动作绑定的验证码票据。
var captcha = root.CaptchaPages;
var sceneCode = getCaptchaScene(formType);
var operationCode = getCaptchaOperation(formType);
if (!sceneCode) return true;
if (!operationCode) return true;
if (!captcha || !captcha.ensureToken) {
showMessage('验证码组件未加载,请刷新后重试');
return false;
}
return Boolean(await captcha.ensureToken(form, {
sceneCode: sceneCode,
operationCode: operationCode,
subject: subject || ''
}));
}
@@ -295,7 +295,7 @@
}
async function sendPhoneCode(button) {
// 换绑手机号使用独立短信场景,避免复用登录或找回密码票据。
// 换绑手机号使用独立认证动作,避免复用登录或找回密码票据。
var api = getApi();
var form = query('[data-security-form="phone"]');
var values;
@@ -311,9 +311,8 @@
button.disabled = true;
try {
await api.sendSmsCode({
await api.sendSmsCode(getCaptchaOperation('phone'), {
phone: values.phone,
sceneCode: getCaptchaScene('phone'),
validToken: values.validToken || ''
});
clearCaptchaToken(form);
@@ -342,9 +341,8 @@
button.disabled = true;
try {
await api.sendSmsCode({
await api.sendSmsCode(getCaptchaOperation('deactivate'), {
phone: boundPhone,
sceneCode: getCaptchaScene('deactivate'),
validToken: values.validToken || ''
});
clearCaptchaToken(form);
@@ -460,7 +458,7 @@
buildPasswordChangeBody: buildPasswordChangeBody,
buildPhoneChangeBody: buildPhoneChangeBody,
buildDeactivateBody: buildDeactivateBody,
getCaptchaScene: getCaptchaScene,
getCaptchaOperation: getCaptchaOperation,
isDangerConfirmed: isDangerConfirmed,
isPhone: isPhone,
isSmsCode: isSmsCode,