feat: plugin function is ready

This commit is contained in:
RockYang
2023-07-15 21:52:30 +08:00
parent 3e41edd3b5
commit accf8eeb77
9 changed files with 200 additions and 46 deletions

View File

@@ -46,7 +46,7 @@ type CodeStats struct {
// Token 生成自验证 token
func (h *VerifyHandler) Token(c *gin.Context) {
// 如果不是通过浏览器访问,则返回错误的 token
if c.GetHeader("Sec-Fetch-Mode") != "cors" {
if c.GetHeader("Sec-Invoke-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 {