新增 SPUG 短信模板与短信兜底发送

This commit is contained in:
2026-07-10 12:27:35 +08:00
parent f19a609462
commit 58a7932f54
28 changed files with 1125 additions and 206 deletions
+1
View File
@@ -12,6 +12,7 @@ import type { IdType } from '@/utils/id'
export interface SendVerificationCodeRequest {
phone: string
sceneCode?: string
clientType?: string
}
/**
+1 -1
View File
@@ -385,7 +385,7 @@ export const userApi = {
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
* @param data: { phone: string; sceneCode?: string } caller-supplied value for `data: { phone: string; sceneCode?: string }`
*/
sendVerificationCode: (data: { phone: string; sceneCode?: string }) => {
sendVerificationCode: (data: { phone: string; sceneCode?: string; clientType?: string }) => {
return api.post('/user/send-verification-code', data)
},
/**
@@ -501,7 +501,8 @@ const handleSendVerificationCode = async () => {
try {
await runWithGlobalLoading(() => userApi.sendVerificationCode({
phone: bindPhoneForm.phone,
sceneCode: 'USER_BIND_PHONE_SMS_CODE'
sceneCode: 'USER_BIND_PHONE_SMS_CODE',
clientType: 'WEB'
}))
message.success('验证码发送成功')
startCountdown()
@@ -528,7 +529,8 @@ const handleSendChangePhoneVerificationCode = async () => {
try {
await runWithGlobalLoading(() => userApi.sendVerificationCode({
phone: changePhoneForm.newPhone,
sceneCode: 'USER_CHANGE_PHONE_SMS_CODE'
sceneCode: 'USER_CHANGE_PHONE_SMS_CODE',
clientType: 'WEB'
}))
message.success('验证码发送成功')
startCountdown()
@@ -556,7 +558,8 @@ const handleSendChangePasswordVerificationCode = async () => {
try {
await runWithGlobalLoading(() => userApi.sendVerificationCode({
phone,
sceneCode: 'USER_CHANGE_PASSWORD_SMS_CODE'
sceneCode: 'USER_CHANGE_PASSWORD_SMS_CODE',
clientType: 'WEB'
}))
message.success('验证码发送成功')
startCountdown()
+4 -2
View File
@@ -1112,7 +1112,8 @@ const handleSendForgotCode = async () => {
try {
await runWithGlobalLoading(() => authApi.sendVerificationCode({
phone: forgotPasswordForm.phone,
sceneCode: 'USER_RESET_PASSWORD_SMS_CODE'
sceneCode: 'USER_RESET_PASSWORD_SMS_CODE',
clientType: 'WEB'
}))
message.success('验证码已发送')
forgotCountdown.value = 60
@@ -1204,7 +1205,8 @@ const handleSendVerificationCode = async () => {
await runWithGlobalLoading(() => userApi.sendVerificationCode({
phone: formData.phone,
sceneCode: activeTab.value === 'register' ? 'USER_REGISTER_SMS_CODE' : 'USER_LOGIN_SMS_CODE'
sceneCode: activeTab.value === 'register' ? 'USER_REGISTER_SMS_CODE' : 'USER_LOGIN_SMS_CODE',
clientType: 'WEB'
}))
message.success('验证码已发送')
countdown.value = 60
@@ -239,7 +239,8 @@ const handleSendVerificationCode = async () => {
try {
await runWithGlobalLoading(() => userApi.sendVerificationCode({
phone: userPhone.value,
sceneCode: 'USER_CHANGE_PASSWORD_SMS_CODE'
sceneCode: 'USER_CHANGE_PASSWORD_SMS_CODE',
clientType: 'WEB'
}))
message.success('验证码发送成功')
startCountdown()