Merge branch 'sqlsugar-dev' into sqlsugar
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Permission($"{nameof(T)}:get:one")]
|
[Permission($"{nameof(T)}:get:list")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public virtual async Task<Result> GetById(long id)
|
public virtual async Task<Result> GetById(long id)
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="queryCondition"></param>
|
/// <param name="queryCondition"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Permission($"{nameof(T)}:get:page")]
|
[Permission($"{nameof(T)}:get:list")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public virtual async Task<Result> PageList(QueryPageCondition queryCondition)
|
public virtual async Task<Result> PageList(QueryPageCondition queryCondition)
|
||||||
{
|
{
|
||||||
@@ -91,7 +91,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ids"></param>
|
/// <param name="ids"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Permission($"{nameof(T)}:delete:list")]
|
[Permission($"{nameof(T)}:del")]
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
public virtual async Task<Result> DeleteList(List<long> ids)
|
public virtual async Task<Result> DeleteList(List<long> ids)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ namespace Yi.Framework.WebCore.AttributeExtend
|
|||||||
Regex regex = new Regex($"^{permission.ToLower()}");
|
Regex regex = new Regex($"^{permission.ToLower()}");
|
||||||
foreach (var p in perList)
|
foreach (var p in perList)
|
||||||
{
|
{
|
||||||
|
//过滤多余的标签
|
||||||
|
p.Replace("Entity","");
|
||||||
|
p.Replace("entity","");
|
||||||
if (regex.IsMatch(p))
|
if (regex.IsMatch(p))
|
||||||
{
|
{
|
||||||
result = true;
|
result = true;
|
||||||
|
|||||||
29
Yi.Vue2.x/src/util/menuDic.js
Normal file
29
Yi.Vue2.x/src/util/menuDic.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
//匹配菜单,让code变成路由
|
||||||
|
const menuDic=
|
||||||
|
{
|
||||||
|
"user:get:list": "/admuser",
|
||||||
|
"role:get:list": "/admrole",
|
||||||
|
"menu:get:list":"/admmenu",
|
||||||
|
"rolemenu:set:list":"/admrolemenu"
|
||||||
|
}
|
||||||
|
//匹配按钮,判断是否有按钮存在
|
||||||
|
const btnDic=
|
||||||
|
{
|
||||||
|
"user:add":"",
|
||||||
|
"user:update":"",
|
||||||
|
"user:del":"",
|
||||||
|
}
|
||||||
|
export default {menuDic,btnDic};
|
||||||
|
//菜单可以区分使用code来进行匹配
|
||||||
|
//记得:关于*的使用,要单独判断
|
||||||
|
//比如,
|
||||||
|
|
||||||
|
//按钮是user:*或者*:*:*直接全部放行即可
|
||||||
|
|
||||||
|
//菜单就不一样了,如果是*:*:*
|
||||||
|
//有两种方案:
|
||||||
|
//1:直接使用一个默认的全部菜单(会和后端给的菜单冲突)
|
||||||
|
//2:前端直接无视,*:*:*相当于只管后端权限(如果后端没有配置菜单前端将没有菜单了)
|
||||||
|
|
||||||
|
|
||||||
|
//如果查询找到的是user:*,可以先把*全部替换成get:list再进行比对即可
|
||||||
@@ -104,7 +104,7 @@ export default {
|
|||||||
axiosUrls: {},
|
axiosUrls: {},
|
||||||
headers: [
|
headers: [
|
||||||
{ text: "用户名", value: "userName", sortable: false },
|
{ text: "用户名", value: "userName", sortable: false },
|
||||||
{ text: "密码", value: "password", sortable: false },
|
|
||||||
{ text: "图标", value: "icon", sortable: false },
|
{ text: "图标", value: "icon", sortable: false },
|
||||||
{ text: "昵称", value: "nick", sortable: true },
|
{ text: "昵称", value: "nick", sortable: true },
|
||||||
{ text: "邮箱", value: "email", sortable: true },
|
{ text: "邮箱", value: "email", sortable: true },
|
||||||
|
|||||||
Reference in New Issue
Block a user