Skip to content

Commit fcae048

Browse files
author
GongJS
committed
Merge branch 'develop' of github.com:TaleLin/lin-cms-vue into develop
2 parents 80f2883 + d49c027 commit fcae048

22 files changed

Lines changed: 313 additions & 348 deletions

File tree

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ENV = 'development'
22

3-
VUE_APP_BASE_URL = 'http://koa.lin.colorful3.com/'
3+
VUE_APP_BASE_URL = 'http://localhost:5000/'

.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
VUE_APP_BASE_URL = 'http://dev.lin.colorful3.com'
3+
VUE_APP_BASE_URL = 'http://localhost:5000/'

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,22 @@ QQ群搜索:林间有风 或 643205479
8989

9090
## 版本日志
9191

92-
<<<<<<< HEAD
93-
最新版本 `0.2.0`
92+
最新版本 `0.2.1`
93+
94+
### 0.2.1
95+
96+
1. `A` 新增一键清除 reuse tab
97+
2. `A` 新增侧边导航搜索,可在 config 配置是否启用
98+
3. `F` 修复 post put 等请求不能自动重发问题
99+
4. `U` 优化异常处理,框架默认弹出前端配置异常信息,可通过 handleError 和 showBackend 控制本次请求是否开发者自行处理和是否直接展示后端返回异常信息
100+
5. `C` 登录用户名字段由 nickname -> username,同时新增 nickname 为昵称字段,可以更新昵称(需后端同步修改)
101+
6. `U` 优化了一些移动端适配
102+
7. `C` 列表信息字段由 collection -> items, total_nums -> tatal, 增加 count、page、total_page字段(需后端同步修改)
94103

95104
### 0.2.0
96105

97106
1. `A` 新增图像上传、图像预览、富文本等自定义组件
98107
2. `A` 新增 lin-cms-ui 多个基础组件
99-
=======
100-
最新版本 `0.1.0-beta.3`
101-
>>>>>>> 0b890cda57f1aaa11af9315d031ae15fae4def51
102108

103109
### 0.1.0-beta.3
104110

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "lin-cms",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"private": true,
55
"scripts": {
66
"serve": "node script/plugin-get-config.js && vue-cli-service serve",
77
"build": "node script/plugin-get-config.js && vue-cli-service build",
88
"lint": "vue-cli-service lint",
9-
"commitizen": "commitizen init cz-conventional-changelog --save-dev --save-exact",
9+
"commit": "git-cz",
1010
"plugin-init": "node script/plugin-init.js",
1111
"plugin-new": "node script/plugin-new.js",
1212
"plugin-reconfig": "node script/plugin-get-config.js",

public/iconfont111.css

Lines changed: 0 additions & 201 deletions
This file was deleted.

src/assets/styles/realize/element-variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ thead tr {
429429
}
430430

431431
.el-menu-vertical-demo {
432-
padding-top: 20px;
432+
padding-top: 10px;
433433
border-right: 1px solid #1d2a60;
434434
}
435435

src/components/base/tinymce/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default {
6969
})
7070
_this.$axios({
7171
method: 'post',
72-
url: '/cms/file/',
72+
url: '/cms/file',
7373
data: {
7474
file,
7575
},

src/components/base/upload-imgs/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export default {
438438
})
439439
return this.$axios({
440440
method: 'post',
441-
url: '/cms/file/',
441+
url: '/cms/file',
442442
data,
443443
}).then((res) => {
444444
if (!Array.isArray(res) || res.length === 0) {

src/components/layout/SideBar.vue

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="app-sidebar">
3-
<div class="logo" v-if="!isCollapse">
3+
<div class="logo" v-if="!elMenuCollapse">
44
<img src="../../assets/img/logo.png" alt="">
55
</div>
66
<div class="mobile-logo" v-else>
@@ -34,7 +34,7 @@
3434
class="el-menu-vertical-demo"
3535
ref="meun"
3636
:default-active="defaultActive"
37-
:collapse="isCollapse"
37+
:collapse="elMenuCollapse"
3838
background-color="#192A5E"
3939
text-color="rgba(196,201,210,1)"
4040
active-text-color="#1890ff">
@@ -112,7 +112,6 @@ import Utils from '@/lin/utils/util'
112112
import Config from '../../config/index'
113113
114114
export default {
115-
props: ['isCollapse'],
116115
data() {
117116
return {
118117
sidebar: '',
@@ -122,6 +121,18 @@ export default {
122121
}
123122
},
124123
inject: ['eventBus'],
124+
props: {
125+
isPhone: {
126+
type: Boolean,
127+
default: false,
128+
},
129+
isCollapse: {
130+
type: Boolean,
131+
default: false,
132+
},
133+
},
134+
created() {
135+
},
125136
mounted() {
126137
this.eventBus.$on('removeSidebarSearch', () => {
127138
this.showSidebarSearch = false
@@ -154,10 +165,10 @@ export default {
154165
}, 200)
155166
},
156167
search(val) {
157-
if (!val) {
158-
this.showSearchList = false
159-
return
160-
}
168+
// if (!val) {
169+
// this.showSearchList = false
170+
// return
171+
// }
161172
this.groups = []
162173
163174
// 深度遍历配置树, 摘取叶子节点作为路由部分
@@ -188,6 +199,13 @@ export default {
188199
},
189200
},
190201
computed: {
202+
elMenuCollapse() {
203+
if (this.isPhone) {
204+
return false
205+
}
206+
207+
return this.isCollapse
208+
},
191209
// 根据当前路由设置激活侧边栏
192210
defaultActive() {
193211
for (let i = (this.stageInfo.length - 1); i >= 0; i -= 1) {
@@ -227,7 +245,7 @@ export default {
227245
return mapData
228246
},
229247
imgSrc() {
230-
return this.isCollapse === false ? '../../assets/img/left-logo.png' : '../../assets/img/logo.png'
248+
return this.elMenuCollapse === false ? '../../assets/img/left-logo.png' : '../../assets/img/logo.png'
231249
},
232250
...mapGetters(['sideBarList']),
233251
},
@@ -313,14 +331,14 @@ export default {
313331
width: 80%;
314332
margin: 0 auto;
315333
height: 36px;
316-
border-bottom: 1px $theme solid;
334+
border-bottom: 1px rgb(185, 190, 195) solid;
317335
cursor: pointer;
318336
319337
.el-icon-search {
320338
position: absolute;
321339
left: 1px;
322340
top: 10px;
323-
color: $theme;
341+
color: rgb(185, 190, 195);
324342
}
325343
}
326344

src/components/layout/User.vue

Lines changed: 80 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,25 @@
1212
<img :src="user.avatar || defaultAvatar" alt="头像">
1313
<label class="mask">
1414
<i class="iconfont icon-icon-test" style="font-size: 20px;"></i>
15-
<input
16-
ref="avatarInput"
17-
type="file"
18-
accept="image/*"
19-
@change="fileChange" />
15+
<input ref="avatarInput" type="file" accept="image/*" @change="fileChange" />
2016
</label>
2117
</div>
2218
<div class="text">
23-
<div class="username">{{ nickname }}</div>
24-
<div class="desc">{{ title }}</div>
19+
<div class="username" @click="changeNickname" v-if="!nicknameChanged">{{ nickname }}</div>
20+
<el-input
21+
placeholder="请输入内容"
22+
size="small"
23+
v-else
24+
v-model="nickname"
25+
ref="input"
26+
@blur="blur"></el-input>
2527
</div>
2628
<img src="../../assets/img/user/corner.png" class="corner">
29+
<div class="info">
30+
<div class="username">{{ username }}</div>
31+
<div class="mid">|</div>
32+
<div class="desc">{{ groupName }}</div>
33+
</div>
2734
</div>
2835
<ul class="dropdown-box">
2936
<li class="password" @click="changePassword">
@@ -150,8 +157,11 @@ export default {
150157
}
151158
}
152159
return {
153-
nickname: null,
160+
username: null,
154161
dialogFormVisible: false,
162+
nicknameChanged: false,
163+
nickname: null,
164+
groupName: null,
155165
form: {
156166
old_password: '',
157167
new_password: '',
@@ -185,13 +195,6 @@ export default {
185195
}
186196
},
187197
computed: {
188-
title() {
189-
const { isSuper } = this.user || {}
190-
if (isSuper) {
191-
return '超级管理员'
192-
}
193-
return '管理员'
194-
},
195198
...mapGetters(['user']),
196199
},
197200
watch: {
@@ -263,7 +266,7 @@ export default {
263266
264267
return this.$axios({
265268
method: 'post',
266-
url: '/cms/file/',
269+
url: '/cms/file',
267270
data: {
268271
file,
269272
},
@@ -302,9 +305,47 @@ export default {
302305
})
303306
})
304307
},
308+
changeNickname() {
309+
this.nicknameChanged = true
310+
setTimeout(() => {
311+
this.$refs.input.focus()
312+
}, 200)
313+
},
314+
async blur() {
315+
if (this.nickname) {
316+
const { user } = this.$store.state
317+
if (this.nickname !== user.nickname && this.nickname !== '佚名') {
318+
this.$axios({
319+
method: 'put',
320+
url: '/cms/user',
321+
data: {
322+
nickname: this.nickname,
323+
},
324+
params: {
325+
showBackend: true,
326+
},
327+
}).then((res) => {
328+
if (res.error_code === 0) {
329+
this.$message({
330+
type: 'success',
331+
message: '更新昵称成功',
332+
})
333+
// 触发重新获取用户信息
334+
return User.getInformation()
335+
}
336+
this.nickname = user.nickname
337+
}).then((res) => { // eslint-disable-line
338+
this.setUserAndState(res)
339+
})
340+
}
341+
}
342+
this.nicknameChanged = false
343+
},
305344
init() {
306345
const { user } = this.$store.state
307-
this.nickname = user ? user.nickname : '未登录'
346+
this.username = user ? user.username : '未登录'
347+
this.groupName = user.groupName ? user.groupName : '超级管理员'
348+
this.nickname = user && user.nickname ? user.nickname : '佚名'
308349
},
309350
changePassword() {
310351
this.dialogFormVisible = true
@@ -335,6 +376,11 @@ export default {
335376
this.$message.success(`${res.msg}`)
336377
this.resetForm(formName)
337378
this.dialogFormVisible = false
379+
setTimeout(() => {
380+
this.loginOut()
381+
const { origin } = window.location
382+
window.location.href = origin
383+
}, 1000)
338384
}
339385
} else {
340386
console.log('error submit!!')
@@ -367,6 +413,7 @@ export default {
367413
368414
.user {
369415
height: 40px;
416+
370417
.el-dropdown-link {
371418
cursor: pointer;
372419
@@ -453,13 +500,29 @@ export default {
453500
.username {
454501
margin-bottom: 10px;
455502
font-size: 16px;
503+
cursor: pointer;
456504
}
457505
458506
.desc {
459507
font-size: 14px;
460508
color: rgba(222, 226, 230, 1);
461509
}
462510
}
511+
512+
.info {
513+
position: absolute;
514+
bottom: 10px;
515+
right: 10px;
516+
display: flex;
517+
color: #fff;
518+
font-size: 14px;
519+
height: 20px;
520+
line-height: 20px;
521+
522+
.mid {
523+
padding: 0 5px;
524+
}
525+
}
463526
}
464527
465528
.dropdown-box {

0 commit comments

Comments
 (0)