Browse Source

Merge branch '20200710_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20200710_xt_api_new_branch

csx 4 years ago
parent
commit
d4c4efd6d5
2 changed files with 2 additions and 11 deletions
  1. 0 8
      controllers/verify_login_controller.go
  2. 2 3
      service/verify_login_token_service.go

+ 0 - 8
controllers/verify_login_controller.go View File

89
 
89
 
90
 	} else {
90
 	} else {
91
 		token := this.GetString("token")
91
 		token := this.GetString("token")
92
-		utils.TraceLog("token: %v", token)
93
 		if len(token) == 0 {
92
 		if len(token) == 0 {
94
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
93
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
95
 			return
94
 			return
96
 		}
95
 		}
97
 
96
 
98
 		ip := utils.GetIP(this.Ctx.Request)
97
 		ip := utils.GetIP(this.Ctx.Request)
99
-		fmt.Println("ip是什么", ip)
100
 		sessionID := this.Ctx.GetCookie("s")
98
 		sessionID := this.Ctx.GetCookie("s")
101
-		fmt.Println("sessionID", sessionID)
102
-		utils.TraceLog("Request: %v", this.Ctx.Request)
103
-		utils.TraceLog("cookie session id: %v", sessionID)
104
 		adminUserInfo, err, errCode := service.VerifyToken(token, ip, sessionID)
99
 		adminUserInfo, err, errCode := service.VerifyToken(token, ip, sessionID)
105
-		fmt.Println("错误是什么", err)
106
-		fmt.Println("errCode是什么", errCode)
107
 		if err != nil {
100
 		if err != nil {
108
 			if errCode == 903 { // 未创建应用
101
 			if errCode == 903 { // 未创建应用
109
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNeverCreateTypeApp)
102
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNeverCreateTypeApp)
147
 			var didRegistedForMall bool = false
140
 			var didRegistedForMall bool = false
148
 
141
 
149
 			tempInfo, _ := service.GetOrgInfoTemplate(curOrg.Id)
142
 			tempInfo, _ := service.GetOrgInfoTemplate(curOrg.Id)
150
-			fmt.Println("teimpInfo", tempInfo)
151
 			template_info := map[string]interface{}{
143
 			template_info := map[string]interface{}{
152
 				"id":          tempInfo.ID,
144
 				"id":          tempInfo.ID,
153
 				"org_id":      tempInfo.OrgId,
145
 				"org_id":      tempInfo.OrgId,

+ 2 - 3
service/verify_login_token_service.go View File

113
 	values.Set("session_id", sessionID)
113
 	values.Set("session_id", sessionID)
114
 
114
 
115
 	resp, requestErr := http.PostForm(api, values)
115
 	resp, requestErr := http.PostForm(api, values)
116
-	fmt.Println("resp", resp)
117
 	if requestErr != nil {
116
 	if requestErr != nil {
118
 		utils.ErrorLog("请求验证 sso token 接口失败: %v", requestErr)
117
 		utils.ErrorLog("请求验证 sso token 接口失败: %v", requestErr)
119
 		return nil, requestErr, 0
118
 		return nil, requestErr, 0
125
 		return nil, ioErr, 0
124
 		return nil, ioErr, 0
126
 	}
125
 	}
127
 	var respJSON map[string]interface{}
126
 	var respJSON map[string]interface{}
128
-	utils.InfoLog(string(body))
127
+
129
 	if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
128
 	if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
130
 		utils.ErrorLog("验证 sso token 接口返回数据解析JSON失败: %v", err)
129
 		utils.ErrorLog("验证 sso token 接口返回数据解析JSON失败: %v", err)
131
 		return nil, err, 0
130
 		return nil, err, 0
132
 	}
131
 	}
133
-	fmt.Println(respJSON)
132
+
134
 
133
 
135
 	if respJSON["state"].(float64) != 1 {
134
 	if respJSON["state"].(float64) != 1 {
136
 		msg := respJSON["msg"].(string)
135
 		msg := respJSON["msg"].(string)