fix(#IY4NN): 演示模式下不允许新建与保存菜单

#Comment
comment #IY4NN

#Issue
close https://gitee.com/LongbowEnterprise/dashboard/issues?id=IY4NN
This commit is contained in:
Argo Zhang 2019-06-19 18:04:48 +08:00
parent 767eeea572
commit bdf79eb61a
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,8 @@ namespace Bootstrap.DataAccess
/// <returns></returns>
public static bool Save(BootstrapMenu p)
{
if (DictHelper.RetrieveSystemModel() && !string.IsNullOrEmpty(p.Id) && RetrieveAllMenus("Admin").Where(m => m.Category == "0" || m.Application == "2").Any(m => m.Id == p.Id)) return true;
// 不允许保存系统菜单与前台演示系统的默认菜单
if (DictHelper.RetrieveSystemModel() && (p.Category == "0" || p.Application == "2")) return true;
if (p.Id == string.Empty) p.Id = null;
var ret = DbContextManager.Create<Menu>().Save(p);