修改制台首页功能
This commit is contained in:
parent
57eb5d6da5
commit
3d457bc8c5
@ -25,5 +25,33 @@ namespace Infrastructure
|
|||||||
/// 用户权限缓存key
|
/// 用户权限缓存key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string UserPermKEY = "CACHE-USER-PERM";
|
public static string UserPermKEY = "CACHE-USER-PERM";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 欢迎语
|
||||||
|
/// </summary>
|
||||||
|
public static string[] WelcomeMessages = new string[] {
|
||||||
|
"祝你开心每一天!",
|
||||||
|
"忙碌了一周,停一停脚步!",
|
||||||
|
"世间美好,与你环环相扣!",
|
||||||
|
"永远相信美好的事情即将发生!",
|
||||||
|
"每一天,遇见更好的自己!",
|
||||||
|
"保持热爱,奔赴山海!",
|
||||||
|
"生活明朗,万物可爱!",
|
||||||
|
"愿每一天醒来都是美好的开始!",
|
||||||
|
"没有希望的地方,就没有奋斗!",
|
||||||
|
"我最珍贵的时光都行走在路上!",
|
||||||
|
"成功,往往住在失败的隔壁!",
|
||||||
|
"人只要不失去方向,就不会失去自己!",
|
||||||
|
"每条堵住的路,都有一个出口!",
|
||||||
|
"没有谁能击垮你,除非你自甘堕落!",
|
||||||
|
"微笑着的人并非没有痛苦!",
|
||||||
|
"生活变的再糟糕,也不妨碍我变得更好!",
|
||||||
|
"你要悄悄努力,然后惊艳众人!",
|
||||||
|
"人与人之间最大的信任是精诚相见",
|
||||||
|
"人生就像爬坡,要一步一步来。",
|
||||||
|
"今天的目标完成了吗?",
|
||||||
|
"高效工作,告别996",
|
||||||
|
"销售是从别人拒绝开始的!"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||||||
List<string> roles = permissionService.GetRolePermission(user);
|
List<string> roles = permissionService.GetRolePermission(user);
|
||||||
//权限集合 eg *:*:*,system:user:list
|
//权限集合 eg *:*:*,system:user:list
|
||||||
List<string> permissions = permissionService.GetMenuPermission(user);
|
List<string> permissions = permissionService.GetMenuPermission(user);
|
||||||
|
user.WelcomeContent = GlobalConstant.WelcomeMessages[new Random().Next(0, GlobalConstant.WelcomeMessages.Length)];
|
||||||
return SUCCESS(new { user, roles, permissions });
|
return SUCCESS(new { user, roles, permissions });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,9 +21,7 @@ namespace ZR.Model.System
|
|||||||
public long UserId { get; set; }
|
public long UserId { get; set; }
|
||||||
//[Duplication]//校验模板类该列数据是否重复
|
//[Duplication]//校验模板类该列数据是否重复
|
||||||
public string UserName { get; set; }
|
public string UserName { get; set; }
|
||||||
|
|
||||||
public string NickName { get; set; }
|
public string NickName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// '用户类型(00系统用户)',
|
/// '用户类型(00系统用户)',
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -32,16 +30,15 @@ namespace ZR.Model.System
|
|||||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||||
[EpplusIgnore]
|
[EpplusIgnore]
|
||||||
public string Avatar { get; set; }
|
public string Avatar { get; set; }
|
||||||
|
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[EpplusIgnore]
|
[EpplusIgnore]
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
|
/// <summary>
|
||||||
//[ColName("手机号")]
|
/// 手机号
|
||||||
|
/// </summary>
|
||||||
public string Phonenumber { get; set; }
|
public string Phonenumber { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户性别(0男 1女 2未知)
|
/// 用户性别(0男 1女 2未知)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -110,6 +107,37 @@ namespace ZR.Model.System
|
|||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
[EpplusIgnore]
|
[EpplusIgnore]
|
||||||
public List<SysRole> Roles { get; set; }
|
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
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,16 +15,16 @@
|
|||||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||||
<!-- </el-tooltip> -->
|
<!-- </el-tooltip> -->
|
||||||
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
<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>
|
||||||
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
<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>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<!-- 通知 -->
|
<!-- 通知 -->
|
||||||
<div class="right-menu-item">
|
<div class="right-menu-item">
|
||||||
<el-popover placement="bottom" trigger="click" v-model="isShowUserNewsPopover" width="300" popper-class="el-popover-pupop-user-news">
|
<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>
|
<i class="el-icon-bell" title="通知"></i>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
<Notice v-show="isShowUserNewsPopover" />
|
<Notice v-show="isShowUserNewsPopover" />
|
||||||
@ -162,9 +162,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.right-menu {
|
.right-menu {
|
||||||
float: right;
|
display: flex;
|
||||||
height: 100%;
|
align-items: center;
|
||||||
line-height: 50px;
|
justify-content: flex-end;
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|||||||
@ -14,31 +14,32 @@
|
|||||||
|
|
||||||
<div class="user-item-right overflow">
|
<div class="user-item-right overflow">
|
||||||
<el-row>
|
<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>
|
||||||
<el-col :span="24">
|
<el-col :xs="24" :sm="24" :md="24">
|
||||||
<el-col :xs="12" :sm="12" :md="8" class="right-l-v">
|
<el-col :xs="24" :md="8" class="right-l-v">
|
||||||
<div class="right-label">昵称:</div>
|
<div class="right-label">昵称:</div>
|
||||||
<div class="right-value">{{userInfo.nickName}}</div>
|
<div class="right-value">{{userInfo.nickName}}</div>
|
||||||
</el-col>
|
</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-label">身份:</div>
|
||||||
<div class="right-value">
|
<div class="right-value">
|
||||||
<span v-for="item in userInfo.roles" :key="item.roleId">{{item.roleName}}</span>
|
<span v-for="item in userInfo.roles" :key="item.roleId">{{item.roleName}}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" class="mt10">
|
<el-col :md="24" class="mt10">
|
||||||
<el-col :xs="12" :sm="12" :md="8" class="right-l-v">
|
<el-col :xs="24" :sm="12" :md="8" class="right-l-v">
|
||||||
<div class="right-label one-text-overflow">IP:</div>
|
<div class="right-label one-text-overflow">IP:</div>
|
||||||
<div class="right-value one-text-overflow">{{userInfo.loginIP}}</div>
|
<div class="right-value one-text-overflow">{{userInfo.loginIP}}</div>
|
||||||
</el-col>
|
</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-label one-text-overflow">时间:</div>
|
||||||
<div class="right-value one-text-overflow">{{ currentTime }}</div>
|
<div class="right-value one-text-overflow">{{ currentTime }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</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">
|
<el-button size="small" icon="el-icon-edit-outline">
|
||||||
<router-link to="/user/profile">
|
<router-link to="/user/profile">
|
||||||
修改信息
|
修改信息
|
||||||
@ -52,7 +53,6 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="24" :lg="8" :xl="8" class="mb10">
|
<el-col :md="24" :lg="8" :xl="8" class="mb10">
|
||||||
<!-- {{userInfo}} -->
|
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>最新文章</span>
|
<span>最新文章</span>
|
||||||
@ -160,7 +160,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dailyMessage: "世间美好,与你环环相扣!",
|
|
||||||
lineChartData: lineChartData.newVisitis,
|
lineChartData: lineChartData.newVisitis,
|
||||||
newArticleList: [],
|
newArticleList: [],
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user