1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- package controllers
-
- import (
- "strings"
-
- "github.com/astaxie/beego"
- )
-
- type IndexController struct {
- BaseController
- }
-
- // / [get]
- func (this *IndexController) Index() {
- mobileAgents := []string{"Android", "iPhone", "iPod", "iPad", "Windows Phone", "MQQBrowser"}
- isFromMobile := false
-
- userAgent := this.Ctx.Request.Header.Get("User-Agent")
- if !strings.Contains(userAgent, "Windows NT") || (strings.Contains(userAgent, "Windows NT") && strings.Contains(userAgent, "compatible; MSIE 9.0;")) {
- if !strings.Contains(userAgent, "Windows NT") && !strings.Contains(userAgent, "Macintosh") {
- for _, mobileAgent := range mobileAgents {
- if strings.Contains(userAgent, mobileAgent) {
- isFromMobile = true
- break
- }
- }
- }
- }
-
- if isFromMobile {
- this.SetTpl("mobile_site/index.html")
- } else {
- this.SetTpl("new_main/index.html")
- }
- }
-
- // /scrm [get]
- func (this *IndexController) SCRMIndex() {
- this.Data["module_url"] = beego.AppConfig.String("submodule_domain_patient_manage")
- this.SetTpl("new_main/scrm_index.html")
- }
-
- // /mmall [get]
- func (this *IndexController) MircoMallIndex() {
- this.Data["module_url"] = beego.AppConfig.String("submodule_domain_mall_manage")
- this.SetTpl("new_main/mircomall_index.html")
- }
-
- // /xt [get]
- func (this *IndexController) XTIndex() {
- this.Data["module_url"] = beego.AppConfig.String("submodule_domain_dialysis_manage")
- this.SetTpl("new_main/xt_index.html")
- }
-
- // /cdm [get]
- func (this *IndexController) CDMIndex() {
- this.Data["module_url"] = beego.AppConfig.String("submodule_domain_cdm_manage")
- this.SetTpl("new_main/cdm_index.html")
- }
-
- // /about [get]
- func (this *IndexController) AboutUs() {
- this.SetTpl("new_main/about.html")
- }
|