|
|
@@ -1,9 +1,13 @@
|
|
|
package middleware
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
sysmodels "git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
|
|
|
"git.qianqiusoft.com/qianqiusoft/light-apiengine/utils"
|
|
|
"github.com/gin-gonic/gin"
|
|
|
+ "strconv"
|
|
|
+ "strings"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
func LoginWare() gin.HandlerFunc {
|
|
|
@@ -22,6 +26,15 @@ func LoginWare() gin.HandlerFunc {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ //非移动端登录
|
|
|
+ userAgent := c.Request.UserAgent()
|
|
|
+ if !(strings.Contains(userAgent, "iPhone") || strings.Contains(userAgent, "Android") || strings.Contains(userAgent, "Dart")) {
|
|
|
+ timestamp_str := strconv.FormatUint(uint64(time.Now().UnixNano()), 10)
|
|
|
+ sec_tooken := utils.GenerateToken(tk.LoginID + timestamp_str)
|
|
|
+ utils.GetGlobalTokenStore().SetPc(sec_tooken, tk)
|
|
|
+ fmt.Println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ userAgent @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:", userAgent)
|
|
|
+ }
|
|
|
+
|
|
|
//wfendpoint := config.AppConfig.GetKey("wfendpoint")
|
|
|
//wfclient.Instance().Init(wfendpoint, tk.UserId, tk.LoginID, tk.AccessToken, tk.Domain)
|
|
|
|