|
@@ -23,13 +23,13 @@ type RequestMsg struct {
|
|
|
Codes []string `json:"codes"` // 留资source
|
|
|
}
|
|
|
|
|
|
-var mobileUrl = regexp.MustCompile("(?i)(app|H5|h5|ios)")
|
|
|
+var mobileReg = regexp.MustCompile("(?i)(Android|Mobile|Phone)")
|
|
|
|
|
|
func (c *Config) GetConfig() {
|
|
|
defer common.Catch()
|
|
|
reqMsg := new(RequestMsg)
|
|
|
if json.Unmarshal(c.Body(), &reqMsg) == nil && len(reqMsg.Codes) > 0 {
|
|
|
- bm := mobileUrl.MatchString(c.Request.Referer()) || mobileUrl.MatchString(c.Request.Host)
|
|
|
+ bm := mobileReg.MatchString(c.Header("User-Agent"))
|
|
|
codes := entity.GetConfig(reqMsg.Codes, bm)
|
|
|
c.ServeJson(api.Result{Data: codes})
|
|
|
return
|