Commit 2e15e380 authored by 张宇迪's avatar 张宇迪

修改字段过滤

parent 9760f193
...@@ -70,10 +70,13 @@ func Proxy(c *gin.Context) { ...@@ -70,10 +70,13 @@ func Proxy(c *gin.Context) {
Return(res) Return(res)
return nil return nil
})) }))
query := ""
c.Request.URL = testutils.ParseURI(proxyData.RealUrl) if proxyData.Data_service_type1 == 2 {
c.Request.RequestURI = proxyData.RealUrl query = "?f=json"
c.Request.Host = getHost(proxyData.RealUrl) }
c.Request.URL = testutils.ParseURI(proxyData.RealUrl + query)
c.Request.RequestURI = proxyData.RealUrl + query
c.Request.Host = getHost(proxyData.RealUrl + query)
f.ServeHTTP(c.Writer, c.Request) f.ServeHTTP(c.Writer, c.Request)
} }
......
package model package model
type ProxyData struct { type ProxyData struct {
RealUrl string `json:"req_url" xorm:"req_url"` RealUrl string `json:"req_url" xorm:"req_url"`
ResFields string `json:"res_fields" xorm:"res_fields text"` ResFields string `json:"res_fields" xorm:"res_fields text"`
Count int `json:"count" xorm:"count"` Count int `json:"count" xorm:"count"`
Sensituve_word string `json:"sensituve_word" xorm:"sensituve_word"` Sensituve_word string `json:"sensituve_word" xorm:"sensituve_word"`
Sensitive_count int `json:"sensitive_count" xorm:"sensitive_count"` Sensitive_count int `json:"sensitive_count" xorm:"sensitive_count"`
Apply_id int `json:"apply_id" xorm:"apply_id"` Apply_id int `json:"apply_id" xorm:"apply_id"`
Service_id int `json:"service_id" xorm:"service_id"` Service_id int `json:"service_id" xorm:"service_id"`
User_id string `json:"user_id" xorm:"user_id"` User_id string `json:"user_id" xorm:"user_id"`
Data_service_type1 int `json:"data_service_type1" xorm:"data_service_type1"`
} }
type WebRes struct { type WebRes struct {
......
...@@ -386,7 +386,7 @@ func GetRealPath(applyId string) (res model.ProxyData, err error) { ...@@ -386,7 +386,7 @@ func GetRealPath(applyId string) (res model.ProxyData, err error) {
} }
has, err := db. has, err := db.
Select(`service_apply.res_fields as res_fields,service.req_url as req_url,service_request_spcs.count as count,service_safe_config.sensituve_word as sensituve_word Select(`service_apply.res_fields as res_fields,service.req_url as req_url,service_request_spcs.count as count,service_safe_config.sensituve_word as sensituve_word
,service_request_spcs.sensitive_count as sensitive_count,service_apply.service_id as service_id,service_apply.id as apply_id,service_apply.user_id as user_id`). ,service_request_spcs.sensitive_count as sensitive_count,service_apply.service_id as service_id,service_apply.id as apply_id,service_apply.user_id as user_id,service.data_service_type1`).
Table(`service`). Table(`service`).
Join(`inner`, `service_apply`, `service_apply.service_id = service.id`). Join(`inner`, `service_apply`, `service_apply.service_id = service.id`).
Join(`left`, `service_request_spcs`, `service_request_spcs.id = service_apply.request_spcs_id`). Join(`left`, `service_request_spcs`, `service_request_spcs.id = service_apply.request_spcs_id`).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment