rdluck 4 years ago
parent
commit
2480ffb16f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      controllers/base_auth.go

+ 5 - 0
controllers/base_auth.go

@@ -33,6 +33,11 @@ func (this *BaseAuthController) Prepare() {
 	if method != "HEAD" {
 		if method == "POST" || method == "GET" {
 			authorization := this.Ctx.Input.Header("Authorization")
+			cookie := this.Ctx.GetCookie("rddp_access_token")
+			utils.FileLog.Info("authorization:%s,cookie:%s", authorization, cookie)
+			if authorization == "" {
+				authorization = cookie
+			}
 			fmt.Println("authorization:", authorization)
 			if authorization == "" {
 				this.JSON(models.BaseResponse{Ret: 408, Msg: "请重新授权!", ErrMsg: "请重新授权:Token is empty or account is empty"}, false, false)