fix: 修复阿里云短信发送失败的 bug

This commit is contained in:
RockYang 2023-07-16 16:05:11 +08:00
parent 49646a79e5
commit 37222f07d9

View File

@ -46,7 +46,7 @@ type CodeStats struct {
// Token 生成自验证 token
func (h *VerifyHandler) Token(c *gin.Context) {
// 如果不是通过浏览器访问,则返回错误的 token
if c.GetHeader("Sec-Invoke-Mode") != "cors" {
if c.GetHeader("Sec-Fetch-Mode") != "cors" {
token := fmt.Sprintf("%s:%d", utils.RandString(32), time.Now().Unix())
encrypt, err := utils.AesEncrypt(h.App.Config.AesEncryptKey, []byte(token))
if err != nil {