config/dev.yaml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
config/pro.yaml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
config/test.yaml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
extend/config/config.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
middlewares/auth/auth.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
config/dev.yaml
@@ -4,8 +4,6 @@ jwtExpire: 24 url: http://127.0.0.1:8080 analyServerId: DSVAD010120190622 imageUrl: http://192.168.1.203:6080 publicDomain: http://bsic.asuscomm.com networkAdapter: enp8s0 #设备编号 deviceNum: 001 config/pro.yaml
@@ -4,8 +4,6 @@ jwtExpire: 24 url: http://127.0.0.1:8080 analyServerId: DSVAD010120190703 imageUrl: http://192.168.1.203:6080 publicDomain: http://bsic.asuscomm.com networkAdapter: enp8s0 #设备编号 deviceNum: 001 config/test.yaml
@@ -4,8 +4,6 @@ jwtExpire: 24 url: http://127.0.0.1:8080 analyServerId: DSVAD010120190703 imageUrl: http://192.168.1.203:6080 publicDomain: http://bsic.asuscomm.com networkAdapter: enp8s0 #设备编号 deviceNum: 001 extend/config/config.go
@@ -11,8 +11,6 @@ JwtExpire string `mapstructure: "jwtExpire"` Url string `mapstructure: "url"` AnalyServerId string `mapstructure: "analyServerId"` ImageUrl string `mapstructure: "imageUrl"` PublicDomain string `mapstructure: "publicDomain"` NetworkAdapter string `mapstructure: "networkAdapter"` DeviceNum string `mapstructure: "deviceNum"` //设备编号 middlewares/auth/auth.go
@@ -5,8 +5,6 @@ "net/http" "strings" "webserver/extend/code" "webserver/extend/config" "basic.com/valib/logger.git" "webserver/extend/util" ) @@ -38,29 +36,6 @@ c.Abort() } c.Next() } else if strings.Contains(urlPath,"/httpImage") { domain := config.Server.PublicDomain //domainReg := regexp.MustCompile(``+domain+``) //if domainReg.MatchString(host) {//域名访问 // imgUrl = domain //} urlPath = strings.Replace(urlPath, "/httpImage", "", -1) if strings.Contains(urlPath,domain) { urlPath = strings.Replace(urlPath,"/"+domain,"",-1) } logger.Debug("urlPath:",urlPath) idx := strings.LastIndex(urlPath, ":") tmpPath := "" if idx >-1 {//路径中包含有端口,取端口以后路径 tmpPath = urlPath[idx:] } else { tmpPath = ":6080"+tmpPath } c.Header("Access-Control-Allow-Origin","*") logger.Debug("domain+tmpPath:",domain+tmpPath) c.Redirect(http.StatusMovedPermanently, domain+tmpPath) return } else { c.Next() }