Browse Source

服务号菜单管理增加权限

master
yashen 9 years ago
parent
commit
8b9c0bc017
2 changed files with 73 additions and 1 deletions
  1. +68
    -0
      B3WeChat.Web/Pages/B3WeChat/Tools/CustomMenuMan.cs
  2. +5
    -1
      WebFolder/config/Plugins/B3WeChat.plugin

+ 68
- 0
B3WeChat.Web/Pages/B3WeChat/Tools/CustomMenuMan.cs View File

@ -0,0 +1,68 @@
using BWP.B3WeChat.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework.Security;
namespace BWP.Web.Pages.B3WeChat.Tools
{
class CustomMenuMan:AppBasePage
{
protected override void InitForm(HtmlForm form)
{
if (!User.IsInRole("B3WeChat.服务号管理.自定义菜单"))
{
throw new AppSecurityException();
}
form.Controls.Add(new LiteralControl("<h1>" + TabTitle + "</h1>"));
var vPanel = new VLayoutPanel();
form.Controls.Add(vPanel);
var toobar = new HLayoutPanel();
vPanel.Add(toobar);
var text = new TextBox();
text.Width = Unit.Percentage(100);
text.TextMode = TextBoxMode.MultiLine;
text.Height = Unit.Pixel(600);
text.Style.Add("margin", "15px");
vPanel.Add(text, new VLayoutOption(HorizontalAlign.Left));
toobar.Add(new TSButton("载入", delegate
{
text.Text = InOutMessageUtil.GetCustomMenu();
AspUtil.Alert(this, "载入自定义菜单成功");
}));
toobar.Add(new TSButton("设置", delegate
{
InOutMessageUtil.SetCustomMenu(text.Text);
AspUtil.Alert(this, "设置自定义菜单成功");
}));
toobar.Add(new TSButton("删除", delegate
{
InOutMessageUtil.DelteCustomMenu();
AspUtil.Alert(this, "删除自定义菜单成功");
}));
}
protected override string TabTitle
{
get
{
return "自定义菜单";
}
}
}
}

+ 5
- 1
WebFolder/config/Plugins/B3WeChat.plugin View File

@ -25,9 +25,13 @@
<Function index="6" name="锁定" />
<Function index="7" name="解锁" />
</FunctionGroup>
<FunctionGroup name="服务号管理" roleSchemas="default">
<Function index="0" name="自定义菜单" />
</FunctionGroup>
</Security>
<Menus>
<Menu id="0001" name="/B3微信/内容模板" roles="B3WeChat.内容模板.访问" url="B3WeChat/ContentTemplate_/ContentTemplateList.aspx"/>
<Menu id="0002" name="/B3微信/自定义菜单" roles="B3WeChat.内容模板.访问" url="B3WeChat/Tools/CustomMenuMan.aspx"/>
<Menu id="0002" name="/B3微信/自定义菜单" roles="B3WeChat.服务号管理.自定义菜单" url="B3WeChat/Tools/CustomMenuMan.aspx" />
</Menus>
</Plugin>

Loading…
Cancel
Save