This commit is contained in:
aozhiwei 2024-07-13 16:51:31 +08:00
parent 81e5f65f46
commit baebc1dff0

View File

@ -1,12 +1,9 @@
package system
import (
"crypto/md5"
"encoding/hex"
"github.com/gin-gonic/gin"
"net/http"
"q5"
"time"
. "main/global"
)
type MetaMaskApi struct {
@ -21,9 +18,7 @@ func (this *MetaMaskApi) GetNonce(c *gin.Context) {
})
return
}
timeUnixNano := time.Now().UnixNano()
sum := md5.Sum([]byte(account + "_" + q5.ToString(timeUnixNano)))
nonce := hex.EncodeToString(sum[:])
nonce := GetSessionMgr().GenNonce()
c.JSON(http.StatusOK, gin.H{
"code": 0,
"message": "success",