This commit is contained in:
owenchen committed 2026-05-12 15:30:20 +08:00
1 parent 647a1c38ab
commit a85e87d330
5 files changed
+20 -18

No files matched your search

+14 -14
View File
@@ -138,9 +138,9 @@ namespace CloudBuilder.Core.Request
if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11);
if (response.ReasonPhrase == "Forbidden")
throw new Exception(string.Format("{0}\r\n{1}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION), errors));
throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION)));
throw new Exception(string.Format("{0}\r\n{1}", response.ReasonPhrase, errors));
throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors));
}
response.EnsureSuccessStatusCode();
@@ -188,9 +188,9 @@ namespace CloudBuilder.Core.Request
if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11);
if (response.ReasonPhrase == "Forbidden")
throw new Exception(string.Format("{0}\r\n{1}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION), errors));
throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION)));
throw new Exception(string.Format("{0}\r\n{1}", response.ReasonPhrase, errors));
throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors));
}
response.EnsureSuccessStatusCode();
@@ -244,9 +244,9 @@ namespace CloudBuilder.Core.Request
if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11);
if (response.ReasonPhrase == "Forbidden")
throw new Exception(string.Format("{0}\r\n{1}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION), errors));
throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION)));
throw new Exception(string.Format("{0}\r\n{1}", response.ReasonPhrase, errors));
throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors));
}
response.EnsureSuccessStatusCode();
@@ -275,9 +275,9 @@ namespace CloudBuilder.Core.Request
if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11);
if (response.ReasonPhrase == "Forbidden")
throw new Exception(string.Format("{0}\r\n{1}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION), errors));
throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION)));
throw new Exception(string.Format("{0}\r\n{1}", response.ReasonPhrase, errors));
throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors));
}
response.EnsureSuccessStatusCode();
@@ -306,9 +306,9 @@ namespace CloudBuilder.Core.Request
if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11);
if (response.ReasonPhrase == "Forbidden")
throw new Exception(string.Format("{0}\r\n{1}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION), errors));
throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION)));
throw new Exception(string.Format("{0}\r\n{1}", response.ReasonPhrase, errors));
throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors));
}
response.EnsureSuccessStatusCode();
@@ -335,9 +335,9 @@ namespace CloudBuilder.Core.Request
if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11);
if (response.ReasonPhrase == "Forbidden")
throw new Exception(string.Format("{0}\r\n{1}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION), errors));
throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION)));
throw new Exception(string.Format("{0}\r\n{1}", response.ReasonPhrase, errors));
throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors));
}
response.EnsureSuccessStatusCode();
@@ -379,9 +379,9 @@ namespace CloudBuilder.Core.Request
if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11);
if (response.ReasonPhrase == "Forbidden")
throw new Exception(string.Format("{0}\r\n{1}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION), errors));
throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION)));
throw new Exception(string.Format("{0}\r\n{1}", response.ReasonPhrase, errors));
throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors));
}
response.EnsureSuccessStatusCode();
+1
View File
@@ -60,6 +60,7 @@ namespace CloudBuilder.Security.Gui
//设置菜单
InitMenu();
//设置欢迎页
DisplayAbstractPage(typeof(WelcomePage).Name);
}
catch (ValidatedException ex)
@@ -22,12 +22,13 @@ namespace CloudBuilder.Security.Gui
private void InitMenu()
{
if (securityMenuData.SecurityFunctionDisplayDatas == null || securityMenuData.SecurityFunctionDisplayDatas.Count() == 0 || securityMenuData.SecurityFunctionMaps == null || securityMenuData.SecurityFunctionMaps.Count() == 0)
this.mainMenu.Items.Clear();
if (securityMenuData == null || securityMenuData.SecurityFunctionDisplayDatas == null || securityMenuData.SecurityFunctionDisplayDatas.Count() == 0 || securityMenuData.SecurityFunctionMaps == null || securityMenuData.SecurityFunctionMaps.Count() == 0)
{
return;
}
this.mainMenu.Items.Clear();
Dictionary<string, ToolStripMenuItem> menuItems = new Dictionary<string, ToolStripMenuItem>();
SetMenuItem();
@@ -228,7 +228,7 @@ namespace CloudBuilder.Security.Service
}
}
[PermissionOperate(name: SecurityPermissionPolicy.SecurityUser, operate: Operate.None)]
[AllowAnonymous]
public SecurityFunctionResultData FindMenuByUsername()
{
string username = service.UserId;
@@ -214,7 +214,7 @@ this.securityUserService= securityUserService;
}
}
[PermissionOperate(name: "SecurityUser", operate: "None")]
[AllowAnonymous]
[HttpPost]
public dynamic FindMenuByUsername()
{