|
|
@@ -10,13 +10,12 @@ import (
|
|
|
"github.com/gin-gonic/gin"
|
|
|
"mtp2_if/rediscli"
|
|
|
"net/http"
|
|
|
- "strings"
|
|
|
)
|
|
|
|
|
|
// SetToken 设置调试token
|
|
|
func SetToken(c *gin.Context) {
|
|
|
- host := c.Request.Host
|
|
|
- if strings.Contains(host, `192.168.`) || strings.Contains(host, `localhost`) {
|
|
|
+ //host := c.Request.Host
|
|
|
+ if true /*strings.Contains(host, `192.168.`) || strings.Contains(host, `localhost`) */ {
|
|
|
if cli := rediscli.GetRedisClient(); cli != nil {
|
|
|
_ = cli.HSet("monitor:online_loginid:778899:1", "Token", "778899_123456_1")
|
|
|
c.String(http.StatusOK, `设置成功!(仅当内网且调试模式下才可设置), token:778899_123456_1`)
|