12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package service
-
- import (
- "net/url"
-
- "SSO/utils"
-
- "github.com/astaxie/beego"
- )
-
- func GetAppURLWithAppType(appType int) string {
- switch appType {
- case 1:
- return beego.AppConfig.String("submodule_domain_patient_manage")
- // case 2:
- // return beego.AppConfig.String("submodule_domain_knowledge_manage")
- case 3:
- return beego.AppConfig.String("submodule_domain_dialysis_manage")
- case 4:
- return beego.AppConfig.String("submodule_domain_cdm_manage")
- case 5:
- return beego.AppConfig.String("submodule_domain_mall_manage")
- default:
- utils.WarningLog("不存在应用类型为 %v 的应用", appType)
- return ""
- }
- }
-
- func GetAppTypeWithAppURL(appURL string) int {
- u, parseErr := url.Parse(appURL)
- if parseErr != nil {
- utils.ErrorLog("app url 解析错误:%v", appURL)
- return 0
- }
- domain := u.Host
- switch domain {
- case beego.AppConfig.String("submodule_domain_patient_manage"):
- return 1
- // case beego.AppConfig.String("submodule_domain_knowledge_manage"):
- // return 2
- case beego.AppConfig.String("submodule_domain_dialysis_manage"):
- return 3
- case beego.AppConfig.String("submodule_domain_cdm_manage"):
- return 4
- case beego.AppConfig.String("submodule_domain_cdm_manage"):
- return 5
- default:
- utils.WarningLog("不存在域名为 %v 的应用", appURL)
- return 0
- }
- }
|