This commit is contained in:
lzh 2025-06-20 14:49:45 +08:00
parent 992f39109d
commit 2e8f0cb3f2

View File

@ -70,7 +70,15 @@ func (c *SmsClient) GetCode(ctx context.Context, key string) (code string, err e
if err != nil { if err != nil {
return "", err return "", err
} }
return value.(string), nil if value == nil {
return "", errors.New("验证码不存在,请重新发送")
}
switch value.(type) {
case string:
return value.(string), nil
default:
return "", errors.New("验证码类型错误,请联系管理员")
}
} }
// SaveCode 保存验证码 // SaveCode 保存验证码