From b409d4f1aab61465250552fcb9fcd7d09f3df005 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期五, 05 七月 2019 19:29:40 +0800
Subject: [PATCH] test
---
controllers/user.go | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/controllers/user.go b/controllers/user.go
index 8286562..693efb6 100644
--- a/controllers/user.go
+++ b/controllers/user.go
@@ -4,6 +4,7 @@
"basic.com/dbapi.git"
"fmt"
"github.com/gin-gonic/gin"
+ "github.com/gin-gonic/gin/internal/json"
"time"
"webserver/extend/code"
"webserver/extend/util"
@@ -37,12 +38,16 @@
return
}
var api dbapi.UserApi
- flag, userInfo := api.Login(userName, password)
+ flag, data := api.Login(userName, password)
if flag {
authDriver := auth.GenerateAuthDriver()
- tokenStr := (*authDriver).Login(c.Request, c.Writer, util.Struct2Map(userInfo))
+ loginedM := util.Struct2Map(data)
+ b, _ := json.Marshal(loginedM["data"])
+ uMap :=make(map[string]interface{},0)
+ json.Unmarshal(b,uMap)
+ tokenStr := (*authDriver).Login(c.Request, c.Writer, uMap)
c.JSON(200,map[string]interface{}{
- "userInfo":userInfo.(map[string]interface{})["data"],
+ "userInfo":uMap,
"access_token":tokenStr,
"refresh_token":tokenStr,
"scope":"app",
--
Gitblit v1.8.0