add
This commit is contained in:
@@ -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, ... }
|
||||
|
||||
Reference in New Issue
Block a user