fix: 移除CheckExtValidRequest检查旧token
This commit is contained in:
@@ -189,13 +189,13 @@ func ExtDatabaseExecSQL(w http.ResponseWriter, r *http.Request) {
|
||||
log.Debug("ExtDatabaseExecSQL processing... ")
|
||||
|
||||
var sql []string
|
||||
var err error
|
||||
// var err error
|
||||
|
||||
_, err = services.CheckExtValidRequest(w, r)
|
||||
if err != nil {
|
||||
log.Error("Request error:", err)
|
||||
return
|
||||
}
|
||||
// _, err = services.CheckExtValidRequest(w, r)
|
||||
// if err != nil {
|
||||
// log.Error("Request error:", err)
|
||||
// return
|
||||
// }
|
||||
|
||||
//vars := mux.Vars(r)
|
||||
//tblName := vars["objectTypeValue"]
|
||||
@@ -250,11 +250,11 @@ func ExtDatabaseGetData(w http.ResponseWriter, r *http.Request) {
|
||||
log.Debug("ExtDatabaseGetData processing... ")
|
||||
|
||||
var sql []string
|
||||
token, err := services.CheckExtValidRequest(w, r)
|
||||
if err != nil {
|
||||
log.Error("Request error:", err)
|
||||
return
|
||||
}
|
||||
// token, err := services.CheckExtValidRequest(w, r)
|
||||
// if err != nil {
|
||||
// log.Error("Request error:", err)
|
||||
// return
|
||||
// }
|
||||
|
||||
pack := "dbrest"
|
||||
vars := mux.Vars(r)
|
||||
@@ -262,7 +262,7 @@ func ExtDatabaseGetData(w http.ResponseWriter, r *http.Request) {
|
||||
dbname := vars["elementTypeValue"]
|
||||
tbname := vars["objectTypeValue"]
|
||||
|
||||
log.Debugf("token:%s, method:%s, module:%s, dbname:%s, tbname:%s, pack:%s", token, r.Method, module, dbname, tbname, pack)
|
||||
log.Debugf("method:%s, module:%s, dbname:%s, tbname:%s, pack:%s", r.Method, module, dbname, tbname, pack)
|
||||
|
||||
// exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), module, dbname, tbname, pack)
|
||||
// if err != nil {
|
||||
@@ -296,12 +296,11 @@ func ExtDatabaseGetData(w http.ResponseWriter, r *http.Request) {
|
||||
for i, s := range sql {
|
||||
log.Tracef("SQL[%d]: %s", i, sql[i])
|
||||
|
||||
rows := make([]map[string]interface{}, 0)
|
||||
mapRows := make(map[string]interface{})
|
||||
|
||||
if s != "" {
|
||||
// err = XEngine.SQL(s).Find(&rows)
|
||||
if IsQuerySQL(s) == false {
|
||||
if !IsQuerySQL(s) {
|
||||
services.ResponseNotAcceptable406QuerySQLError(w)
|
||||
return
|
||||
}
|
||||
@@ -311,7 +310,7 @@ func ExtDatabaseGetData(w http.ResponseWriter, r *http.Request) {
|
||||
querySQL = querySQL + " " + ls
|
||||
}
|
||||
log.Debug("querySQL:", querySQL)
|
||||
rows, err = DbClient.XEngine.QueryInterface(querySQL)
|
||||
rows, err := DbClient.XEngine.QueryInterface(querySQL)
|
||||
if err != nil {
|
||||
log.Error("SQL failed:", err)
|
||||
services.ResponseInternalServerError500DatabaseOperationFailed(w)
|
||||
@@ -333,11 +332,11 @@ func ExtDatabaseGetData(w http.ResponseWriter, r *http.Request) {
|
||||
func ExtDatabaseInsertData(w http.ResponseWriter, r *http.Request) {
|
||||
log.Debug("ExtDatabaseInsertData processing... ")
|
||||
|
||||
token, err := services.CheckExtValidRequest(w, r)
|
||||
if err != nil {
|
||||
log.Error("Request error:", err)
|
||||
return
|
||||
}
|
||||
// token, err := services.CheckExtValidRequest(w, r)
|
||||
// if err != nil {
|
||||
// log.Error("Request error:", err)
|
||||
// return
|
||||
// }
|
||||
|
||||
body, err := io.ReadAll(io.LimitReader(r.Body, global.RequestBodyMaxLen)) //io.LimitReader限制大小
|
||||
if err != nil {
|
||||
@@ -352,7 +351,7 @@ func ExtDatabaseInsertData(w http.ResponseWriter, r *http.Request) {
|
||||
tbname := vars["objectTypeValue"]
|
||||
pack := "dbrest"
|
||||
|
||||
log.Debugf("token:%s, method:%s, module:%s, dbname:%s, tbname:%s, pack:%s", token, r.Method, module, dbname, tbname, pack)
|
||||
log.Debugf("method:%s, module:%s, dbname:%s, tbname:%s, pack:%s", r.Method, module, dbname, tbname, pack)
|
||||
|
||||
// exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), module, dbname, tbname, pack)
|
||||
// if err != nil {
|
||||
@@ -397,11 +396,11 @@ func ExtDatabaseInsertData(w http.ResponseWriter, r *http.Request) {
|
||||
func ExtDatabaseUpdateData(w http.ResponseWriter, r *http.Request) {
|
||||
log.Debug("ExtDatabaseUpdateData processing... ")
|
||||
|
||||
token, err := services.CheckExtValidRequest(w, r)
|
||||
if err != nil {
|
||||
log.Error("Request error:", err)
|
||||
return
|
||||
}
|
||||
// token, err := services.CheckExtValidRequest(w, r)
|
||||
// if err != nil {
|
||||
// log.Error("Request error:", err)
|
||||
// return
|
||||
// }
|
||||
|
||||
vars := mux.Vars(r)
|
||||
module := ""
|
||||
@@ -409,7 +408,7 @@ func ExtDatabaseUpdateData(w http.ResponseWriter, r *http.Request) {
|
||||
tbname := vars["objectTypeValue"]
|
||||
pack := "dbrest"
|
||||
|
||||
log.Debugf("token:%s, method:%s, module:%s, dbname:%s, tbname:%s, pack:%s", token, r.Method, module, dbname, tbname, pack)
|
||||
log.Debugf("method:%s, module:%s, dbname:%s, tbname:%s, pack:%s", r.Method, module, dbname, tbname, pack)
|
||||
|
||||
// exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), module, dbname, tbname, pack)
|
||||
// if err != nil {
|
||||
@@ -461,11 +460,11 @@ func ExtDatabaseUpdateData(w http.ResponseWriter, r *http.Request) {
|
||||
func ExtDatabaseDeleteData(w http.ResponseWriter, r *http.Request) {
|
||||
log.Debug("ExtDatabaseDeleteData processing... ")
|
||||
|
||||
token, err := services.CheckExtValidRequest(w, r)
|
||||
if err != nil {
|
||||
log.Error("Request error:", err)
|
||||
return
|
||||
}
|
||||
// token, err := services.CheckExtValidRequest(w, r)
|
||||
// if err != nil {
|
||||
// log.Error("Request error:", err)
|
||||
// return
|
||||
// }
|
||||
|
||||
vars := mux.Vars(r)
|
||||
module := ""
|
||||
@@ -473,7 +472,7 @@ func ExtDatabaseDeleteData(w http.ResponseWriter, r *http.Request) {
|
||||
tbname := vars["objectTypeValue"]
|
||||
pack := "dbreset"
|
||||
|
||||
log.Debugf("token:%s, method:%s, module:%, dbname:%s, tbname:%s pack:%s", token, r.Method, module, dbname, tbname, pack)
|
||||
log.Debugf("method:%s, module:%, dbname:%s, tbname:%s pack:%s", r.Method, module, dbname, tbname, pack)
|
||||
|
||||
// exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), module, dbname, tbname, pack)
|
||||
// if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user