修复获取服务器地址端口bug

This commit is contained in:
2018-04-23 21:08:22 +08:00
parent d793309bb5
commit 11a6a65dd3
3 changed files with 158 additions and 158 deletions
+1 -1
View File
@@ -122,7 +122,7 @@ namespace COMCMS.Common
http = "https://";
}
string port = MyHttpContext.Current.Request.Host.Port.ToString();
if (port == "80" || port == "443")
if (string.IsNullOrEmpty(port) || port == "80" || port == "443")
return http + MyHttpContext.Current.Request.Host.Host;
else
return http + MyHttpContext.Current.Request.Host.Host + ":" + port;