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