mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-06-16 05:55:33 +00:00
update check version
This commit is contained in:
parent
94eaba6ecb
commit
bd85cda9fa
@ -2,7 +2,7 @@
|
|||||||
* @Author: LinkLeong link@icewhale.com
|
* @Author: LinkLeong link@icewhale.com
|
||||||
* @Date: 2022-06-17 14:01:25
|
* @Date: 2022-06-17 14:01:25
|
||||||
* @LastEditors: LinkLeong
|
* @LastEditors: LinkLeong
|
||||||
* @LastEditTime: 2022-07-29 16:14:33
|
* @LastEditTime: 2022-07-29 16:22:25
|
||||||
* @FilePath: /CasaOS/pkg/utils/jwt/jwt_helper.go
|
* @FilePath: /CasaOS/pkg/utils/jwt/jwt_helper.go
|
||||||
* @Description:
|
* @Description:
|
||||||
* @Website: https://www.casaos.io
|
* @Website: https://www.casaos.io
|
||||||
@ -38,7 +38,7 @@ func JWT() gin.HandlerFunc {
|
|||||||
//_, err := ParseToken(token)
|
//_, err := ParseToken(token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
code = common_err.ERROR_AUTH_TOKEN
|
code = common_err.ERROR_AUTH_TOKEN
|
||||||
} else if (c.Request.URL.Path == "/v1/file" || c.Request.URL.Path == "/v1/sys/version/check" || c.Request.URL.Path == "/v1/image" || c.Request.URL.Path == "/v1/file/upload" || c.Request.URL.Path == "/v1/batch") && claims.VerifyIssuer("casaos", true) {
|
} else if (c.Request.URL.Path == "/v1/file" || c.Request.URL.Path == "/v1/image" || c.Request.URL.Path == "/v1/file/upload" || c.Request.URL.Path == "/v1/batch") && claims.VerifyIssuer("casaos", true) {
|
||||||
//Special treatment
|
//Special treatment
|
||||||
} else if !claims.VerifyExpiresAt(time.Now(), true) || !claims.VerifyIssuer("casaos", true) {
|
} else if !claims.VerifyExpiresAt(time.Now(), true) || !claims.VerifyIssuer("casaos", true) {
|
||||||
code = common_err.ERROR_AUTH_TOKEN
|
code = common_err.ERROR_AUTH_TOKEN
|
||||||
|
@ -44,6 +44,7 @@ func InitRouter() *gin.Engine {
|
|||||||
r.GET("/v1/sys/debug", v1.GetSystemConfigDebug) // //debug
|
r.GET("/v1/sys/debug", v1.GetSystemConfigDebug) // //debug
|
||||||
|
|
||||||
r.GET("/v1/sys/socket-port", v1.GetSystemSocketPort) //sys/socket_port
|
r.GET("/v1/sys/socket-port", v1.GetSystemSocketPort) //sys/socket_port
|
||||||
|
r.GET("/v1/sys/version/check", v1.GetSystemCheckVersion)
|
||||||
|
|
||||||
v1Group := r.Group("/v1")
|
v1Group := r.Group("/v1")
|
||||||
|
|
||||||
@ -113,7 +114,7 @@ func InitRouter() *gin.Engine {
|
|||||||
v1SysGroup.Use()
|
v1SysGroup.Use()
|
||||||
{
|
{
|
||||||
v1SysGroup.GET("/version", v1.GetSystemCheckVersion) //version/check
|
v1SysGroup.GET("/version", v1.GetSystemCheckVersion) //version/check
|
||||||
v1SysGroup.GET("/version/check", v1.GetSystemCheckVersion)
|
|
||||||
v1SysGroup.POST("/update", v1.SystemUpdate)
|
v1SysGroup.POST("/update", v1.SystemUpdate)
|
||||||
|
|
||||||
v1SysGroup.GET("/hardware", v1.GetSystemHardwareInfo) //hardware/info
|
v1SysGroup.GET("/hardware", v1.GetSystemHardwareInfo) //hardware/info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user