[FIX]Header
This commit is contained in:
parent
1ca77573bc
commit
829767b821
|
@ -39,6 +39,7 @@ func GetBusinesses(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept mpfd
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param name formData string true "业务系统 名称"
|
||||
// @Param desc formData string false "业务系统 描述"
|
||||
// @Param c_id formData int false "业务系统 云端id"
|
||||
|
@ -75,6 +76,7 @@ func AddBusiness(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept mpfd
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param id path int true "业务系统 ID"
|
||||
// @Param name formData string false "业务系统 名称"
|
||||
// @Param desc formData string false "业务系统 描述"
|
||||
|
@ -123,6 +125,7 @@ func EditBusiness(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param id path int true "业务系统 ID"
|
||||
// @Success 200 {string} json "{"code" : 200, "msg" : "ok"}"
|
||||
// @Router /v1/businesses/{id} [delete]
|
||||
|
|
|
@ -17,6 +17,7 @@ import (
|
|||
// @Description
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Success 200 {string} json "{"code" : 200, "basic" : {}, "msg": "ok" }"
|
||||
// @Router /v1/meta_databases [get]
|
||||
func GetMetaDatabases(c *gin.Context) {
|
||||
|
@ -45,6 +46,7 @@ func GetMetaDatabases(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept mpfd
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param name formData string true "数据源 名称"
|
||||
// @Param host formData string true "数据源 地址"
|
||||
// @Param port formData int true "数据源 端口号"
|
||||
|
@ -122,6 +124,7 @@ func AddMetaDatabase(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept mpfd
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param id path int true "数据源 ID"
|
||||
// @Param name formData string false "数据源 名称"
|
||||
// @Param host formData string false "数据源 地址"
|
||||
|
@ -210,6 +213,7 @@ func EditMetaDatabase(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param id path int true "数据源 ID"
|
||||
// @Success 200 {string} json "{"code" : 200, "msg" : "ok"}"
|
||||
// @Router /v1/meta_databases/{id} [delete]
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
// @Description
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param id path int true "数据源 ID"
|
||||
// @Success 200 {string} json "{"code" : 200, "basic" : {}, "msg": "ok" }"
|
||||
// @Router /v1/meta_databases/{id}/meta_tables [get]
|
||||
|
|
|
@ -16,6 +16,7 @@ import (
|
|||
// @Description
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Success 200 {string} json "{"code" : 200, "data" : {}, "msg" : "ok"}"
|
||||
// @Router /v1/vendors [get]
|
||||
func GetVendors(c *gin.Context) {
|
||||
|
@ -38,6 +39,7 @@ func GetVendors(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept mpfd
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param name formData string true "系统厂商 名称"
|
||||
// @Param c_id formData int false "系统厂商 云端id"
|
||||
// @Success 200 {string} json "{"code" : 200, "msg" : "ok"}"
|
||||
|
@ -72,6 +74,7 @@ func AddVendor(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept mpfd
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param id path int true "系统厂商 ID"
|
||||
// @Param name formData string false "系统厂商 名称"
|
||||
// @Param c_id formData int false "系统厂商 云端id"
|
||||
|
@ -117,6 +120,7 @@ func EditVendor(c *gin.Context) {
|
|||
// @Description
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "auth by /auth"
|
||||
// @Param id path int true "系统厂商 ID"
|
||||
// @Success 200 {string} json "{"code" : 200, "msg" : "ok"}"
|
||||
// @Router /v1/vendors/{id} [delete]
|
||||
|
|
|
@ -24,10 +24,14 @@ func JWT() gin.HandlerFunc {
|
|||
} else if time.Now().Unix() > claims.ExpiresAt {
|
||||
code = e.ERROR_AUTH_CHECK_TOKEN_TIMEOUT
|
||||
}
|
||||
username := claims.Username
|
||||
loginUUID := claims.StandardClaims.Id
|
||||
val, err := util.Redis.Get("login:" + loginUUID).Result()
|
||||
if val != username {
|
||||
if claims != nil {
|
||||
username := claims.Username
|
||||
loginUUID := claims.StandardClaims.Id
|
||||
val, _ := util.Redis.Get("login:" + loginUUID).Result()
|
||||
if val != username {
|
||||
code = e.ERROR_AUTH_CHECK_TOKEN_FAIL
|
||||
}
|
||||
} else {
|
||||
code = e.ERROR_AUTH_CHECK_TOKEN_FAIL
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package basic
|
||||
|
||||
import "github.com/viletyy/potato/pkg/util"
|
||||
import (
|
||||
"github.com/viletyy/potato/pkg/util"
|
||||
)
|
||||
|
||||
type Business struct {
|
||||
util.Model
|
||||
|
|
Loading…
Reference in New Issue