diff --git a/Bridge/HttpBridgeClient.cs b/Bridge/HttpBridgeClient.cs index 645d6a2..9f1df92 100644 --- a/Bridge/HttpBridgeClient.cs +++ b/Bridge/HttpBridgeClient.cs @@ -348,14 +348,13 @@ namespace UMC.ITME } public static void Check() { - + var now = Utility.TimeSpan(); var ls = System.Buffers.ArrayPool.Shared.Rent(9); try { var vs = _bridgeClients.Values.ToArray(); foreach (var b in vs) { - b.Write(0, ls, 9, 0); } diff --git a/Proxy/SiteSSHActivities.cs b/Proxy/SiteSSHActivities.cs index 0ae0449..da32091 100644 --- a/Proxy/SiteSSHActivities.cs +++ b/Proxy/SiteSSHActivities.cs @@ -499,6 +499,7 @@ class SiteSSHActivities : Web.WebActivity using (var sftp = new SftpClient(new PasswordConnectionInfo(device.Ip, device.Port ?? 22, device.Username, password))) { sftp.Connect(); + var Content = this.AsyncDialog("Content", r => { String s = String.Empty; @@ -514,9 +515,10 @@ class SiteSSHActivities : Web.WebActivity response.Redirect(new WebMeta().Put("Content", s).Put("title", Path)); }); + sftp.DeleteFile(Path); sftp.WriteAllText(Path, Content); - SSHLog(device, this.Context.Token.Username, $"upload {Path}"); + SSHLog(device, this.Context.Token.Username, $"write {Path}"); } } break; diff --git a/Proxy/SiteSetupActivity.cs b/Proxy/SiteSetupActivity.cs index 78d7083..81edd7f 100644 --- a/Proxy/SiteSetupActivity.cs +++ b/Proxy/SiteSetupActivity.cs @@ -15,7 +15,7 @@ using UMC.Data; namespace UMC.ITME.Activities { /// - /// 邮箱账户 + /// 应用安装 /// [UMC.Web.Apiumc("ITME", "Setup", Auth = WebAuthType.Admin)] class SiteSetupActivity : WebActivity @@ -84,7 +84,7 @@ namespace UMC.ITME.Activities } from.Title = "开发者发布"; - from.Add(UICell.Create("QRCode", new WebMeta().Put("value", $"https://api.apiumc.com/UMC/Platform/EditCert/{appId}"))); + from.Add(UICell.QRCode($"https://api.apiumc.com/UMC/Platform/EditCert/{appId}")); from.AddConfirm("请开发者用ITME App扫一扫,生成开发者证书,再点击下一步", "Settings", "YES"); from.Submit("下一步", $"{request.Model}.{request.Command}"); @@ -102,7 +102,7 @@ namespace UMC.ITME.Activities { request.Arguments.Put("ConfKey", "Proxy"); goto case "UMC"; - + } if (data.ContainsKey("success")) { @@ -143,7 +143,7 @@ namespace UMC.ITME.Activities { request.Arguments.Put("ConfKey", "Proxy"); goto case "UMC"; - + } // break; } @@ -227,7 +227,7 @@ namespace UMC.ITME.Activities Domain = new Uri(orgDomain, "/").AbsoluteUri;// this.Context.Request.Arguments.Put("ConfKey", "UMC"); this.Context.Request.Arguments.Put("Domain", Domain); - var str = new Uri(orgDomain, "/UMC.Conf").WebRequest().Put(new WebMeta().Put("domain", $"{Web.WebResource.Instance().WebDomain()}")).ReadAsString(); + var str = new Uri(orgDomain, "/UMC/Conf").WebRequest().Put(new WebMeta().Put("domain", $"{Web.WebResource.Instance().WebDomain()}")).ReadAsString(); var data = JSON.Deserialize(str); if (data?.ContainsKey("appConf") == true) { @@ -237,6 +237,14 @@ namespace UMC.ITME.Activities this.Context.Request.Arguments.Put("IconSrc", appConf["IconSrc"]); config.Put("IconSrc", appConf["IconSrc"]); } + if (appConf.ContainsKey("MarketKey")) + { + site.AuthConf = "#"; + site.UserModel = UserModel.Bridge; + site.AuthType = WebAuthType.Guest; + ConfKey = appConf["MarketKey"] as string; + } + if (appConf.ContainsKey("Open")) { @@ -257,7 +265,7 @@ namespace UMC.ITME.Activities { this.Context.Request.Arguments.Put("Mobile", appConf["Mobile"]); config.Put("Mobile", appConf["Mobile"]); - + } } diff --git a/Proxy/WebFactory.cs b/Proxy/WebFactory.cs index c072deb..7cb8672 100644 --- a/Proxy/WebFactory.cs +++ b/Proxy/WebFactory.cs @@ -40,6 +40,8 @@ namespace UMC.ITME SiteConfig site; public override void ProcessActivity(WebRequest request, WebResponse response) { + + var user = this.Context.Token.Identity(); var httpProxy = new HttpProxy(site, this.Context.Client.Context, -1, "/", String.Empty); if (httpProxy.Domain == null) @@ -347,7 +349,20 @@ namespace UMC.ITME { var site = DataFactory.Instance().SiteConfig(p.Attributes["root"]); if (site != null) + { + if (site.IsClose) + { + if (site.Site.Flag < 0 || site.Domains.Length == 0 || String.IsNullOrEmpty(site.Site.MarketKey)) + { + return WebActivity.Empty; + } + else + { + this.Prompt("许可证已过期", $"{site.Site}的许可证已经过期,请联系管理员更新许可证"); + } + } return new XHRActivity(site); + } } } diff --git a/Resources/desktop.ui.html b/Resources/desktop.ui.html index 006578c..378cc7a 100644 --- a/Resources/desktop.ui.html +++ b/Resources/desktop.ui.html @@ -31,8 +31,7 @@