菜单设置
This commit is contained in:
parent
dbe6de22ad
commit
a9dbcf1b5b
@ -80,6 +80,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
List<string> permissions = permissionService.GetMenuPermission(user);
|
||||
|
||||
LoginUser loginUser = new(user, roles, permissions);
|
||||
//todo 把权限加到缓存里
|
||||
CacheService.SetUserPerms(GlobalConstant.UserPermKEY + user.UserId, permissions);
|
||||
return SUCCESS(JwtUtil.GenerateJwtToken(JwtUtil.AddClaims(loginUser), jwtSettings.JwtSettings));
|
||||
}
|
||||
|
||||
@ -13,10 +13,7 @@ namespace ZR.Admin.WebApi.Extensions
|
||||
|
||||
Console.WriteLine(content);
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
Console.WriteLine("🎉源码地址: https://gitee.com/izory/ZrAdminNetCore");
|
||||
Console.WriteLine("📖官方文档:http://www.izhaorui.cn/doc");
|
||||
Console.WriteLine("🤑打赏作者:http://www.izhaorui.cn/doc/support.html");
|
||||
Console.WriteLine("📱移动端体验:http://www.izhaorui.cn/h5");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,11 +42,12 @@ namespace ZR.Admin.WebApi.Filters
|
||||
var isAuthed = context.HttpContext.User.Identity.IsAuthenticated;
|
||||
|
||||
//使用jwt token校验2020-11-21
|
||||
//todo 认证是否合法用户和校验
|
||||
LoginUser info = JwtUtil.GetLoginUser(context.HttpContext);
|
||||
|
||||
if (info == null || !isAuthed)
|
||||
{
|
||||
string msg = $"请求访问[{url}]失败,无法访问系统资源";
|
||||
string msg = $"非法用户 请求访问[{url}]失败,无法访问系统资源";
|
||||
logger.Info($"{msg}");
|
||||
|
||||
context.Result = new JsonResult(new ApiResult((int)ResultCode.DENY, msg));
|
||||
|
||||
@ -63,7 +63,7 @@ namespace ZR.Admin.WebApi.Framework
|
||||
return tokenHandler.WriteToken(token);
|
||||
}
|
||||
/// <summary>
|
||||
/// 验证Token
|
||||
/// 检查客户端和服务器的Token是否一样
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static TokenValidationParameters ValidParameters()
|
||||
@ -117,7 +117,7 @@ namespace ZR.Admin.WebApi.Framework
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// jwt token校验
|
||||
/// jwt token校验 合法用户和其权限
|
||||
/// </summary>
|
||||
/// <param name="jwtToken"></param>
|
||||
/// <returns></returns>
|
||||
@ -131,7 +131,9 @@ namespace ZR.Admin.WebApi.Framework
|
||||
if (userData != null)
|
||||
{
|
||||
loginUser = JsonConvert.DeserializeObject<LoginUser>(userData);
|
||||
//todo 从缓存拿到权限,如果拿不到权限说明非法用户
|
||||
var permissions = CacheService.GetUserPerms(GlobalConstant.UserPermKEY + loginUser?.UserId);
|
||||
|
||||
if (loginUser?.UserName == GlobalConstant.AdminRole)
|
||||
{
|
||||
permissions = new List<string>() { GlobalConstant.AdminPerm };
|
||||
|
||||
@ -46,6 +46,7 @@ builder.Services.AddAuthentication(options =>
|
||||
}).AddCookie()
|
||||
.AddJwtBearer(o =>
|
||||
{
|
||||
// 检查客户端和服务器的Token是否一样
|
||||
o.TokenValidationParameters = JwtUtil.ValidParameters();
|
||||
o.Events = new JwtBearerEvents
|
||||
{
|
||||
@ -116,7 +117,9 @@ app.UseRouting();
|
||||
app.UseCors("Policy");//要放在app.UseEndpoints前。
|
||||
//app.UseHttpsRedirection();
|
||||
|
||||
//todo 认证
|
||||
app.UseAuthentication();
|
||||
//todo 授权
|
||||
app.UseAuthorization();
|
||||
|
||||
//开启缓存
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
___________ _ _ _ _ ______ _______
|
||||
|___ / __ \ /\ | | (_) | \ | | ____|__ __|
|
||||
/ /| |__) | / \ __| |_ __ ___ _ _ __ | \| | |__ | |
|
||||
/ / | _ / / /\ \ / _` | '_ ` _ \| | '_ \ | . ` | __| | |
|
||||
/ /__| | \ \ / ____ \ (_| | | | | | | | | | |_| |\ | |____ | |
|
||||
/_____|_| \_\/_/ \_\__,_|_| |_| |_|_|_| |_(_)_| \_|______| |_|
|
||||
|
||||
__ __ ______ _____
|
||||
| \/ | ____|/ ____|
|
||||
| \ / | |__ | (___
|
||||
| |\/| | __| \___ \
|
||||
| | | | |____ ____) |
|
||||
|_| |_|______|_____/
|
||||
@ -35,7 +35,7 @@ namespace ZR.Service.System
|
||||
var predicate = Expressionable.Create<SysDept>();
|
||||
predicate = predicate.And(it => it.DelFlag == 0);
|
||||
predicate = predicate.AndIF(dept.DeptName.IfNotEmpty(), it => it.DeptName.Contains(dept.DeptName));
|
||||
predicate = predicate.AndIF(dept.Status != null, it => it.Status == dept.Status);
|
||||
predicate = predicate.AndIF(dept.Status != null, it => it.Status == Convert.ToChar(dept.Status));
|
||||
|
||||
var response = GetList(predicate.ToExpression());
|
||||
|
||||
@ -112,7 +112,7 @@ namespace ZR.Service.System
|
||||
private void UpdateParentDeptStatusNormal(SysDept dept)
|
||||
{
|
||||
long[] depts = Tools.SpitLongArrary(dept.Ancestors);
|
||||
dept.Status = 0;
|
||||
dept.Status = '0';
|
||||
dept.Update_time = DateTime.Now;
|
||||
|
||||
Update(dept, it => new { it.Update_by, it.Update_time, it.Status }, f => depts.Contains(f.DeptId));
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
ENV = 'development'
|
||||
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 'ZrAdmin.NET后台管理'
|
||||
VUE_APP_TITLE = '上海干巷MES'
|
||||
|
||||
# 开发环境
|
||||
VUE_APP_BASE_API = '/dev-api'
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
ENV = 'staging'
|
||||
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 'ZrAdmin.NET后台管理'
|
||||
VUE_APP_TITLE = '上海干巷MES'
|
||||
|
||||
# 测试环境
|
||||
VUE_APP_BASE_API = '/stage-api'
|
||||
|
||||
@ -14,12 +14,7 @@
|
||||
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom"> -->
|
||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||
<!-- </el-tooltip> -->
|
||||
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||
<zr-git class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
||||
<zr-doc class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
|
||||
</template>
|
||||
<!-- 通知 -->
|
||||
<div class="right-menu-item">
|
||||
|
||||
@ -3,7 +3,7 @@ module.exports = {
|
||||
* 框架版本号
|
||||
*/
|
||||
version: '3.8.1',
|
||||
title: 'ZrAdmin.NET-后台管理',
|
||||
title: '上海干巷MES',
|
||||
/**
|
||||
* 主题颜色
|
||||
*/
|
||||
|
||||
0
ZR.Vue/src/views/basisManagement/BOM.vue
Normal file
0
ZR.Vue/src/views/basisManagement/BOM.vue
Normal file
0
ZR.Vue/src/views/basisManagement/devicestation.vue
Normal file
0
ZR.Vue/src/views/basisManagement/devicestation.vue
Normal file
0
ZR.Vue/src/views/basisManagement/line.vue
Normal file
0
ZR.Vue/src/views/basisManagement/line.vue
Normal file
0
ZR.Vue/src/views/basisManagement/materiel.vue
Normal file
0
ZR.Vue/src/views/basisManagement/materiel.vue
Normal file
0
ZR.Vue/src/views/basisManagement/procedure.vue
Normal file
0
ZR.Vue/src/views/basisManagement/procedure.vue
Normal file
0
ZR.Vue/src/views/basisManagement/process.vue
Normal file
0
ZR.Vue/src/views/basisManagement/process.vue
Normal file
0
ZR.Vue/src/views/basisManagement/sop.vue
Normal file
0
ZR.Vue/src/views/basisManagement/sop.vue
Normal file
0
ZR.Vue/src/views/basisManagement/tray.vue
Normal file
0
ZR.Vue/src/views/basisManagement/tray.vue
Normal file
15
ZR.Vue/src/views/basisManagement/unit.vue
Normal file
15
ZR.Vue/src/views/basisManagement/unit.vue
Normal file
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
unit
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
0
ZR.Vue/src/views/basisManagement/workshop.vue
Normal file
0
ZR.Vue/src/views/basisManagement/workshop.vue
Normal file
0
ZR.Vue/src/views/basisManagement/workstation.vue
Normal file
0
ZR.Vue/src/views/basisManagement/workstation.vue
Normal file
0
ZR.Vue/src/views/deviceManagement/device_type.vue
Normal file
0
ZR.Vue/src/views/deviceManagement/device_type.vue
Normal file
0
ZR.Vue/src/views/deviceManagement/repairlist.vue
Normal file
0
ZR.Vue/src/views/deviceManagement/repairlist.vue
Normal file
0
ZR.Vue/src/views/productManagement/dispatch.vue
Normal file
0
ZR.Vue/src/views/productManagement/dispatch.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/FQC.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/FQC.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/IPQC.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/IPQC.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/IQC.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/IQC.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/OQC.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/OQC.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/checkItem.vue
Normal file
0
ZR.Vue/src/views/qualityManagement/checkItem.vue
Normal file
0
ZR.Vue/src/views/warehouseManagement/define.vue
Normal file
0
ZR.Vue/src/views/warehouseManagement/define.vue
Normal file
0
ZR.Vue/src/views/warehouseManagement/stock.vue
Normal file
0
ZR.Vue/src/views/warehouseManagement/stock.vue
Normal file
Loading…
x
Reference in New Issue
Block a user