Ver Fonte

fix(登录逻辑):调整登录逻辑

Roc há 3 anos atrás
pai
commit
d851ab304d
2 ficheiros alterados com 4 adições e 2 exclusões
  1. 4 0
      controllers/admin.go
  2. 0 2
      controllers/approval.go

+ 4 - 0
controllers/admin.go

@@ -36,6 +36,10 @@ func (this *AdminCommon) Login() {
 	}
 
 	adminWx, err := services.BindWxUser(this.Session.OpenId, req.Username, req.Password, utils.WxPlatform)
+	if err != nil {
+		this.FailWithMessage("登录失败", "登录失败,Err:"+err.Error())
+		return
+	}
 	err = h5_admin_session.UpdateSession(this.Session.SessionId, adminWx.AdminId, time.Now().AddDate(0, 0, 90))
 	if err != nil {
 		this.FailWithMessage("登录失败", "变更session信息失败,Err:"+err.Error())

+ 0 - 2
controllers/approval.go

@@ -2,7 +2,6 @@ package controllers
 
 import (
 	"encoding/json"
-	"fmt"
 	approval2 "hongze/hongze_mobile_admin/models/request/approval"
 	"hongze/hongze_mobile_admin/models/response/approval"
 	"hongze/hongze_mobile_admin/models/tables/admin"
@@ -117,7 +116,6 @@ func (this *ApprovalCommon) List() {
 			}
 			list[i].DelayPermission = delayPermission
 		}
-		fmt.Println(item.ApproveRoleTypeCode, "===", roleTypeCode)
 		if item.ApproveRoleTypeCode == roleTypeCode {
 			list[i].OpButton = true
 		}