import (

	"strings"

	"github.com/astaxie/beego"

)

type Isphome struct{

	beego.Controller

}

func (c *Isphome)Isphone() bool{

	//User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0

	UserAgent := c.Ctx.Request.Header.Get("User-Agent")

	//找不到返回 -1 成功为正数

	i := strings.Index(UserAgent, "Windows")

	if i> -1 {

		return true

	}else{

		return false

	}

}
