mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 02:29:24 +08:00
完成直接为用户分配模块
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Infrastructure;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.App.ViewModel;
|
||||
using OpenAuth.Mvc.Models;
|
||||
using WebGrease.Css.Extensions;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
@@ -69,5 +73,21 @@ namespace OpenAuth.Mvc.Controllers
|
||||
|
||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||
}
|
||||
|
||||
public string AccessModule(int userId, string moduleIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
var ids = moduleIds.Split(',').Select(id => int.Parse(id)).ToArray();
|
||||
_app.AccessModules(userId, ids);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
BjuiResponse.message = e.Message;
|
||||
BjuiResponse.statusCode = "300";
|
||||
}
|
||||
|
||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user