Skip to content

Commit

Permalink
update jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
3xxx committed Jul 31, 2021
1 parent f15d7cc commit 2594ba5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion controllers/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import (
"strings"
// "time"
"fmt"
jwt "github.com/dgrijalva/jwt-go"
// jwt "github.com/dgrijalva/jwt-go"
jwt "github.com/golang-jwt/jwt"
)

// CMSToken API
Expand Down
4 changes: 3 additions & 1 deletion controllers/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,8 @@ func (c *ProjController) ProjectUserRole() {
}
}

//管理员或本人修改项目名称、负责人等,
// 管理员或本人修改项目名称、负责人等,
// 没有修改硬盘目录,需要手动修改!!
func (c *ProjController) UpdateProject() {
_, _, uid, isadmin, isLogin := checkprodRole(c.Ctx)
if !isLogin {
Expand Down Expand Up @@ -1562,6 +1563,7 @@ func (c *ProjController) UpdateProject() {
if err != nil {
beego.Error(err)
}
//没有修改硬盘目录,需要手动修改!!

if err != nil {
c.Data["json"] = "修改出错-写入数据库出错!"
Expand Down
5 changes: 3 additions & 2 deletions controllers/utils/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
// "github.com/astaxie/beego/orm"
"encoding/base64"
"encoding/json"
"github.com/dgrijalva/jwt-go"
// "github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt"
"net/http"
"strconv"
"strings"
Expand All @@ -18,7 +19,7 @@ import (

const (
KEY string = "JWT-ARY-STARK"
DEFAULT_EXPIRE_SECONDS int = 600 // default 10 minutes
DEFAULT_EXPIRE_SECONDS int = 3000 //600 // default 10 minutes
//SecretKey = "welcome to wangshubo's blog"
SecretKey = "I have login"
secret = "I have login"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/casbin/casbin v1.9.1
github.com/casbin/xorm-adapter v1.0.0
github.com/dchest/lru v0.0.0-20151022103600-d8fd1e40a385 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/golang-jwt/jwt@v3.2.1+incompatible
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/go-sql-driver/mysql v1.6.0
github.com/go-xorm/xorm v0.7.9 // indirect
Expand Down

0 comments on commit 2594ba5

Please sign in to comment.