rename package name & fix bug

This commit is contained in:
jianzhiyao
2022-04-27 23:05:08 +08:00
parent 6fffb3196f
commit 978b7e4a9d
91 changed files with 231 additions and 251 deletions

View File

@@ -15,7 +15,7 @@
// Package context provide the context utils
// Usage:
//
// import "github.com/astaxie/beego/context"
// import "github.com/beego/beego/context"
//
// ctx := context.Context{Request:req,ResponseWriter:rw}
//
@@ -35,7 +35,7 @@ import (
"strings"
"time"
"github.com/astaxie/beego/utils"
"github.com/beego/beego/utils"
)
//commonly used mime-types
@@ -147,7 +147,7 @@ func (ctx *Context) SetSecureCookie(Secret, name, value string, others ...interf
// XSRFToken creates a xsrf token string and returns.
// others[0] bool secure
// others[1] bool http-only
func (ctx *Context) XSRFToken(key string, expire int64, others...interface{}) string {
func (ctx *Context) XSRFToken(key string, expire int64, others ...interface{}) string {
if ctx._xsrfToken == "" {
token, ok := ctx.GetSecureCookie(key, "_xsrf")
if !ok {
@@ -157,7 +157,7 @@ func (ctx *Context) XSRFToken(key string, expire int64, others...interface{}) st
secure = others[0].(bool)
}
httpOnly := false
if len(others) > 1{
if len(others) > 1 {
httpOnly = others[1].(bool)
}
ctx.SetSecureCookie(key, "_xsrf", token, expire, "", "", secure, httpOnly)

View File

@@ -29,7 +29,7 @@ import (
"strings"
"sync"
"github.com/astaxie/beego/session"
"github.com/beego/beego/session"
)
// Regexes for checking the accept headers

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"reflect"
beecontext "github.com/astaxie/beego/context"
"github.com/astaxie/beego/logs"
beecontext "github.com/beego/beego/context"
"github.com/beego/beego/logs"
)
// ConvertParams converts http method params to values that will be passed to the method controller as arguments