Skip to content

Commit 9a4667f

Browse files
author
pixel
committed
添加个人中心遮罩,添加自动更改title功能
1 parent e102f82 commit 9a4667f

File tree

3 files changed

+40
-11
lines changed

3 files changed

+40
-11
lines changed

web/src/permission.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import router from './router'
22
import { store } from '@/store/index'
3+
import getPageTitle from '@/utils/page'
34

45
let asyncRouterFlag = 0
56

@@ -8,6 +9,8 @@ const whiteList = ['login']
89
router.beforeEach(async(to, from, next) => {
910
const token = store.getters['user/token']
1011
// 在白名单中的判断情况
12+
//修改网页标签名称
13+
document.title = getPageTitle(to.meta.title)
1114
if (whiteList.indexOf(to.name) > -1) {
1215
if (token) {
1316
next({ path: '/layout/dashboard' })

web/src/utils/page.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const title = 'GIN-VUE-ADMIN'
2+
3+
export default function getPageTitle(pageTitle) {
4+
if (pageTitle) {
5+
return `${pageTitle} - ${title}`
6+
}
7+
return `${title}`
8+
}

web/src/view/person/person.vue

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@
44
<el-col :span="6">
55
<div class="fl-left avatar-box">
66
<div class="user-card">
7-
<el-avatar
8-
class="user-avatar"
9-
:size="160"
10-
:src="userInfo.headerImg"
11-
shape="square"
12-
@click.native="openChooseImg"
13-
></el-avatar>
7+
<div class="user-headpic-update" :style="{ 'background-image': 'url(' + userInfo.headerImg + ')','background-repeat':'no-repeat','background-size':'cover' }" >
8+
<span class="update" @click="openChooseImg">
9+
<i class="el-icon-edit"></i>
10+
重新上传</span>
11+
</div>
1412
<div class="user-personality">
1513
<p class="nickname">{{userInfo.nickName}}</p>
1614
<p class="person-info">这个家伙很懒,什么都没有留下</p>
1715
</div>
1816
<div class="user-information">
1917
<ul>
2018
<li>
21-
<i class="el-icon-user"></i>资深前端工程师
19+
<i class="el-icon-user"></i>{{userInfo.nickName}}
2220
</li>
2321
<li>
2422
<i class="el-icon-data-analysis"></i>北京反转极光科技有限公司-技术部-前端事业群
@@ -216,9 +214,6 @@ export default {
216214
box-shadow: -2px 0 20px -16px;
217215
width: 80%;
218216
height: 100%;
219-
.user-avatar{
220-
cursor: pointer;
221-
}
222217
.user-card {
223218
min-height: calc(90vh - 200px);
224219
padding: 30px 20px;
@@ -282,4 +277,27 @@ export default {
282277
}
283278
}
284279
}
280+
.user-headpic-update{
281+
width: 120px;
282+
height: 120px;
283+
line-height: 120px;
284+
margin: 0 auto;
285+
display: flex;
286+
justify-content: center;
287+
border-radius: 20px;
288+
&:hover{
289+
color: #fff;
290+
background: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.15) 100%), radial-gradient(at top center, rgba(255,255,255,0.40) 0%, rgba(0,0,0,0.40) 120%) #989898;
291+
background-blend-mode: multiply,multiply;
292+
.update{
293+
color:#fff ;
294+
}
295+
}
296+
.update{
297+
height: 120px;
298+
width: 120px;
299+
text-align: center;
300+
color:transparent;
301+
}
302+
}
285303
</style>

0 commit comments

Comments
 (0)