This commit is contained in:
Mrx
2026-02-27 14:49:21 +08:00
parent 4db033c557
commit c9ef3f6f9c
12 changed files with 335 additions and 29 deletions

View File

@@ -330,12 +330,17 @@ export const useUserStore = defineStore('user', () => {
}
// 发送验证码(使用自定义编码和签名)
const sendCode = async (phone, scene) => {
const sendCode = async (phone, scene, captchaVerifyParam = null) => {
try {
// 1. 生成签名并编码请求数据
const encodedRequest = await generateSMSRequest(phone, scene)
// 2. 发送编码后的请求只包含data字段
// 2. 如果有滑块验证码参数,添加到请求数据中
if (captchaVerifyParam) {
encodedRequest.captchaVerifyParam = captchaVerifyParam
}
// 3. 发送编码后的请求
const response = await userApi.sendCode(encodedRequest)
// 后端返回格式: { success: true, data: {...}, message, ... }