修改制台首页功能

This commit is contained in:
不做码农 2022-02-28 21:37:25 +08:00
parent 57eb5d6da5
commit 3d457bc8c5
5 changed files with 79 additions and 24 deletions

View File

@ -25,5 +25,33 @@ namespace Infrastructure
/// 用户权限缓存key
/// </summary>
public static string UserPermKEY = "CACHE-USER-PERM";
/// <summary>
/// 欢迎语
/// </summary>
public static string[] WelcomeMessages = new string[] {
"祝你开心每一天!",
"忙碌了一周,停一停脚步!",
"世间美好,与你环环相扣!",
"永远相信美好的事情即将发生!",
"每一天,遇见更好的自己!",
"保持热爱,奔赴山海!",
"生活明朗,万物可爱!",
"愿每一天醒来都是美好的开始!",
"没有希望的地方,就没有奋斗!",
"我最珍贵的时光都行走在路上!",
"成功,往往住在失败的隔壁!",
"人只要不失去方向,就不会失去自己!",
"每条堵住的路,都有一个出口!",
"没有谁能击垮你,除非你自甘堕落!",
"微笑着的人并非没有痛苦!",
"生活变的再糟糕,也不妨碍我变得更好!",
"你要悄悄努力,然后惊艳众人!",
"人与人之间最大的信任是精诚相见",
"人生就像爬坡,要一步一步来。",
"今天的目标完成了吗?",
"高效工作告别996",
"销售是从别人拒绝开始的!"
};
}
}

View File

@ -125,7 +125,7 @@ namespace ZR.Admin.WebApi.Controllers.System
List<string> roles = permissionService.GetRolePermission(user);
//权限集合 eg *:*:*,system:user:list
List<string> permissions = permissionService.GetMenuPermission(user);
user.WelcomeContent = GlobalConstant.WelcomeMessages[new Random().Next(0, GlobalConstant.WelcomeMessages.Length)];
return SUCCESS(new { user, roles, permissions });
}

View File

@ -21,9 +21,7 @@ namespace ZR.Model.System
public long UserId { get; set; }
//[Duplication]//校验模板类该列数据是否重复
public string UserName { get; set; }
public string NickName { get; set; }
/// <summary>
/// '用户类型00系统用户',
/// </summary>
@ -32,16 +30,15 @@ namespace ZR.Model.System
[SugarColumn(IsOnlyIgnoreInsert = true)]
[EpplusIgnore]
public string Avatar { get; set; }
public string Email { get; set; }
[JsonIgnore]
[EpplusIgnore]
public string Password { get; set; }
//[ColName("手机号")]
/// <summary>
/// 手机号
/// </summary>
public string Phonenumber { get; set; }
/// <summary>
/// 用户性别0男 1女 2未知
/// </summary>
@ -76,7 +73,7 @@ namespace ZR.Model.System
/// 部门Id
/// </summary>
public long DeptId { get; set; }
#region
public bool IsAdmin()
{
@ -110,6 +107,37 @@ namespace ZR.Model.System
[SugarColumn(IsIgnore = true)]
[EpplusIgnore]
public List<SysRole> Roles { get; set; }
[SugarColumn(IsIgnore = true)]
public string WelcomeMessage
{
get
{
int now = DateTime.Now.Hour;
if (now > 0 && now <= 6)
{
return "午夜好";
}
else if (now > 6 && now <= 11)
{
return "早上好";
}
else if (now > 11 && now <= 14)
{
return "中午好";
}
else if (now > 14 && now <= 18)
{
return "下午好";
}
else
{
return "晚上好";
}
}
}
[SugarColumn(IsIgnore = true)]
public string WelcomeContent { get; set; }
#endregion
}

View File

@ -15,16 +15,16 @@
<size-select id="size-select" class="right-menu-item hover-effect" />
<!-- </el-tooltip> -->
<el-tooltip content="源码地址" effect="dark" placement="bottom">
<zr-git id="zr-git" class="right-menu-item hover-effect" />
<zr-git class="right-menu-item hover-effect" />
</el-tooltip>
<el-tooltip content="文档地址" effect="dark" placement="bottom">
<zr-doc id="zr-doc" class="right-menu-item hover-effect" />
<zr-doc class="right-menu-item hover-effect" />
</el-tooltip>
</template>
<!-- 通知 -->
<div class="right-menu-item">
<el-popover placement="bottom" trigger="click" v-model="isShowUserNewsPopover" width="300" popper-class="el-popover-pupop-user-news">
<el-badge @click.stop="isShowUserNewsPopover = !isShowUserNewsPopover" slot="reference">
<el-badge @click.stop="isShowUserNewsPopover = !isShowUserNewsPopover" :is-dot="true" slot="reference">
<i class="el-icon-bell" title="通知"></i>
</el-badge>
<Notice v-show="isShowUserNewsPopover" />
@ -162,9 +162,9 @@ export default {
}
.right-menu {
float: right;
height: 100%;
line-height: 50px;
display: flex;
align-items: center;
justify-content: flex-end;
&:focus {
outline: none;

View File

@ -14,31 +14,32 @@
<div class="user-item-right overflow">
<el-row>
<el-col :span="24" class="right-title mb20 one-text-overflow">您好{{ userInfo.nickName }}{{ dailyMessage }}
<el-col :xs="24" :md="24" class="right-title mb20 one-text-overflow">
{{userInfo.welcomeMessage}}{{ userInfo.nickName }}{{ userInfo.welcomeContent }}
</el-col>
<el-col :span="24">
<el-col :xs="12" :sm="12" :md="8" class="right-l-v">
<el-col :xs="24" :sm="24" :md="24">
<el-col :xs="24" :md="8" class="right-l-v">
<div class="right-label">昵称</div>
<div class="right-value">{{userInfo.nickName}}</div>
</el-col>
<el-col :xs="12" :sm="12" :md="16" class="right-l-v">
<el-col :xs="24" :md="16" class="right-l-v">
<div class="right-label">身份</div>
<div class="right-value">
<span v-for="item in userInfo.roles" :key="item.roleId">{{item.roleName}}</span>
</div>
</el-col>
</el-col>
<el-col :span="24" class="mt10">
<el-col :xs="12" :sm="12" :md="8" class="right-l-v">
<el-col :md="24" class="mt10">
<el-col :xs="24" :sm="12" :md="8" class="right-l-v">
<div class="right-label one-text-overflow">IP</div>
<div class="right-value one-text-overflow">{{userInfo.loginIP}}</div>
</el-col>
<el-col :xs="12" :sm="12" :md="16" class="right-l-v">
<el-col :xs="24" :sm="12" :md="16" class="right-l-v">
<div class="right-label one-text-overflow">时间</div>
<div class="right-value one-text-overflow">{{ currentTime }}</div>
</el-col>
</el-col>
<el-col :span="24" class="mt10">
<el-col :lg="24" class="mt10">
<el-button size="small" icon="el-icon-edit-outline">
<router-link to="/user/profile">
修改信息
@ -52,7 +53,6 @@
</el-card>
</el-col>
<el-col :md="24" :lg="8" :xl="8" class="mb10">
<!-- {{userInfo}} -->
<el-card shadow="hover">
<div slot="header">
<span>最新文章</span>
@ -160,7 +160,6 @@ export default {
},
data() {
return {
dailyMessage: "世间美好,与你环环相扣!",
lineChartData: lineChartData.newVisitis,
newArticleList: [],
};