Skip to content

Commit 3bff01d

Browse files
authored
Upgrade to version 0.3.4 (#299)
* refactor: optimize * refactor(*): optimize variable naming
1 parent ff03afe commit 3bff01d

22 files changed

+52
-254
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ QQ群搜索:林间有风 或 643205479
9797

9898
## 版本日志
9999

100-
最新版本 `0.3.3`
100+
最新版本 `0.3.4`
101+
102+
### 0.3.4
103+
104+
1. `U` 优化变量命名,升级 `element-ui` 版本,
105+
2. `F` `Home` 组件改为异步加载
101106

102107
### 0.3.3
103108

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lin-cms",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"private": true,
55
"scripts": {
66
"serve": "node script/plugin-get-config.js && vue-cli-service serve",
@@ -17,7 +17,7 @@
1717
"@babel/polyfill": "^7.4.4",
1818
"@tinymce/tinymce-vue": "^2.0.0",
1919
"axios": "~0.18.0",
20-
"element-ui": "^2.10.1",
20+
"element-ui": "^2.13.0",
2121
"event-source-polyfill": "^1.0.7",
2222
"fastscan": "^1.0.4",
2323
"good-storage": "^1.1.0",

public/iconfont1.css

-209
This file was deleted.

public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
.loader-logo {
2525
width: 60px;
26-
height: 98px;
26+
height: 91px;
2727
position: fixed;
2828
left: 20%;
2929
top: 43%;

public/static/img/logo.png

4.34 KB
Loading

src/components/layout/User.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export default {
277277
})
278278
.then(putRes => {
279279
// eslint-disable-line
280-
if (putRes.code < window.SUCCESS_CODE) {
280+
if (putRes.code < window.MAX_SUCCESS_CODE) {
281281
this.$message({
282282
type: 'success',
283283
message: '更新头像成功',
@@ -315,7 +315,7 @@ export default {
315315
showBackend: true,
316316
})
317317
.then(res => {
318-
if (res.code < window.SUCCESS_CODE) {
318+
if (res.code < window.MAX_SUCCESS_CODE) {
319319
this.$message({
320320
type: 'success',
321321
message: '更新昵称成功',
@@ -364,7 +364,7 @@ export default {
364364
// eslint-disable-line
365365
if (valid) {
366366
const res = await User.updatePassword(this.form)
367-
if (res.code < window.SUCCESS_CODE) {
367+
if (res.code < window.MAX_SUCCESS_CODE) {
368368
this.$message.success(`${res.message}`)
369369
this.resetForm(formName)
370370
this.dialogFormVisible = false

src/config/global.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
window.SUCCESS_CODE = 9999
1+
window.MAX_MAX_SUCCESS_CODE = 9998

src/lin/models/admin.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ export default class Admin {
99
this.gCount = gCount
1010
}
1111

12-
async increseUpage() {
12+
async increaseUPage() {
1313
this.uPage += 1
1414
}
1515

16-
async increseGpage() {
16+
async increaseGPage() {
1717
this.lPage += 1
1818
}
1919

20-
async decreseUpage() {
20+
async decreaseUPage() {
2121
this.uPage -= 1
2222
if (this.uPage < 0) {
2323
this.uPage = 0
2424
}
2525
}
2626

27-
async decreseGpage() {
27+
async decreaseGPage() {
2828
this.lPage -= 1
2929
if (this.lPage < 0) {
3030
this.lPage = 0
@@ -53,12 +53,12 @@ export default class Admin {
5353
}
5454

5555
async nextUsersPage() {
56-
await this.increseUpage()
56+
await this.increaseUPage()
5757
return this.getAdminUsers({})
5858
}
5959

6060
async preUsersPage() {
61-
await this.decreseUpage()
61+
await this.decreaseUPage()
6262
return this.getAdminUsers({})
6363
}
6464

@@ -71,12 +71,12 @@ export default class Admin {
7171
}
7272

7373
async nextGroupsPage() {
74-
await this.increseGpage()
74+
await this.increaseGPage()
7575
return this.getGroupsWithPermissions({})
7676
}
7777

7878
async preGroupsPage() {
79-
await this.decreseGpage()
79+
await this.decreaseGPage()
8080
return this.getGroupsWithPermissions({})
8181
}
8282

src/lin/models/log.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ class Log {
4141
// lCount && this.lCount = lCount
4242
}
4343

44-
async increseUpage() {
44+
async increaseUpage() {
4545
this.uPage += 1
4646
}
4747

48-
async increseLpage() {
48+
async increaseLpage() {
4949
this.lPage += 1
5050
}
5151

52-
increseSpage() {
52+
increaseSpage() {
5353
this.sPage += 1
5454
}
5555

@@ -149,17 +149,17 @@ class Log {
149149
}
150150

151151
async moreUserPage() {
152-
await this.increseUpage()
152+
await this.increaseUpage()
153153
return this.getLoggedUsers({})
154154
}
155155

156156
async moreLogPage() {
157-
await this.increseLpage()
157+
await this.increaseLpage()
158158
return this.getLogs({ next: true })
159159
}
160160

161161
async moreSearchPage() {
162-
this.increseSpage()
162+
this.increaseSpage()
163163
return this.searchLogs({ next: true })
164164
}
165165
}

src/router/routes.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import Home from '@/views/home/Home'
21
import homeRouter from './home-router'
32

43
const routes = [
54
{
65
path: '/',
76
name: 'Home',
87
redirect: '/about',
9-
component: Home,
8+
component: () => import('@/views/home/Home'),
109
children: [...homeRouter],
1110
},
1211
{

src/store/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Vue from 'vue'
22
import Vuex from 'vuex'
3+
import createLogger from 'vuex/dist/logger'
34
import VuexPersistence from 'vuex-persist'
45
import mutations from './mutations'
56
import state from './state'
@@ -18,11 +19,13 @@ const vuexLocal = new VuexPersistence({
1819
}),
1920
})
2021

22+
const debug = process.env.NODE_ENV !== 'production'
23+
2124
export default new Vuex.Store({
2225
state,
2326
getters,
2427
mutations,
2528
actions,
26-
plugins: [vuexLocal.plugin],
27-
strict: process.env.NODE_ENV !== 'production',
29+
plugins: debug ? [vuexLocal.plugin, createLogger()] : [vuexLocal.plugin],
30+
strict: debug,
2831
})

src/views/admin/group/GroupAdd.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default {
9191
this.loading = false
9292
console.log(e)
9393
}
94-
if (res.code < window.SUCCESS_CODE) {
94+
if (res.code < window.MAX_SUCCESS_CODE) {
9595
this.loading = false
9696
this.$message.success(`${res.message}`)
9797
this.eventBus.$emit('addGroup', true)

src/views/admin/group/GroupList.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default {
124124
if (this.cacheForm.name !== this.form.name || this.cacheForm.info !== this.form.info) {
125125
// eslint-disable-line
126126
const res = await Admin.updateOneGroup(this.form.name, this.form.info, this.id)
127-
if (res.code < window.SUCCESS_CODE) {
127+
if (res.code < window.MAX_SUCCESS_CODE) {
128128
this.$message.success(`${res.message}`)
129129
this.getAllGroups()
130130
}
@@ -150,7 +150,7 @@ export default {
150150
if (deletePermissions.length > 0) {
151151
delRes = await Admin.removePermissions(this.id, deletePermissions)
152152
}
153-
if (addRes.code < window.SUCCESS_CODE || delRes.code < window.SUCCESS_CODE) {
153+
if (addRes.code < window.MAX_SUCCESS_CODE || delRes.code < window.MAX_SUCCESS_CODE) {
154154
this.$message.success('权限修改成功')
155155
}
156156
}
@@ -191,7 +191,7 @@ export default {
191191
this.loading = false
192192
console.log(e)
193193
}
194-
if (res.code < window.SUCCESS_CODE) {
194+
if (res.code < window.MAX_SUCCESS_CODE) {
195195
await this.getAllGroups()
196196
this.$message({
197197
type: 'success',

src/views/admin/user/UserInfo.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export default {
167167
try {
168168
this.loading = true
169169
res = await User.register(this.form)
170-
if (res.code < window.SUCCESS_CODE) {
170+
if (res.code < window.MAX_SUCCESS_CODE) {
171171
this.loading = false
172172
this.$message.success(`${res.message}`)
173173
this.eventBus.$emit('addUser', true)
@@ -198,7 +198,7 @@ export default {
198198
this.loading = false
199199
console.log(e)
200200
}
201-
if (res.code < window.SUCCESS_CODE) {
201+
if (res.code < window.MAX_SUCCESS_CODE) {
202202
this.loading = false
203203
this.$message.success(`${res.message}`)
204204
this.$emit('handleInfoResult', true)

src/views/admin/user/UserList.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export default {
170170
this.loading = false
171171
console.log(e)
172172
}
173-
if (res.code < window.SUCCESS_CODE) {
173+
if (res.code < window.MAX_SUCCESS_CODE) {
174174
this.loading = false
175175
if (this.total_nums % this.pageCount === 1 && this.currentPage !== 1) {
176176
// 判断删除的是不是每一页的最后一条数据

src/views/admin/user/UserPassword.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default {
8181
this.loading = false
8282
console.log(e)
8383
}
84-
if (res.code < window.SUCCESS_CODE) {
84+
if (res.code < window.MAX_SUCCESS_CODE) {
8585
this.loading = false
8686
this.$message.success(`${res.message}`)
8787
this.resetForm(formName)

src/views/book/BookAdd.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default {
5454
async submitForm(formName) {
5555
try {
5656
const res = await book.addBook(this.form)
57-
if (res.code < window.SUCCESS_CODE) {
57+
if (res.code < window.MAX_SUCCESS_CODE) {
5858
this.$message.success(`${res.message}`)
5959
this.resetForm(formName)
6060
}

src/views/book/BookEdit.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060
methods: {
6161
async submitForm() {
6262
const res = await book.editBook(this.editBookID, this.form)
63-
if (res.code < window.SUCCESS_CODE) {
63+
if (res.code < window.MAX_SUCCESS_CODE) {
6464
this.$message.success(`${res.message}`)
6565
this.$emit('editClose')
6666
}

src/views/book/BookList.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default {
7676
type: 'warning',
7777
}).then(async () => {
7878
const res = await book.delectBook(val.row.id)
79-
if (res.code < window.SUCCESS_CODE) {
79+
if (res.code < window.MAX_SUCCESS_CODE) {
8080
this.getBooks()
8181
this.$message({
8282
type: 'success',

src/views/center/Center.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ export default {
266266
})
267267
.then(putRes => {
268268
// eslint-disable-line
269-
if (putRes.code < window.SUCCESS_CODE) {
269+
if (putRes.code < window.MAX_SUCCESS_CODE) {
270270
this.$message({
271271
type: 'success',
272272
message: '更新头像成功',
@@ -298,7 +298,7 @@ export default {
298298
showBackend: true,
299299
})
300300
.then(res => {
301-
if (res.code < window.SUCCESS_CODE) {
301+
if (res.code < window.MAX_SUCCESS_CODE) {
302302
this.$message({
303303
type: 'success',
304304
message: '更新昵称成功',
@@ -336,7 +336,7 @@ export default {
336336
// eslint-disable-line
337337
if (valid) {
338338
const res = await User.updatePassword(this.form)
339-
if (res.code < window.SUCCESS_CODE) {
339+
if (res.code < window.MAX_SUCCESS_CODE) {
340340
this.$message.success(`${res.message}`)
341341
this.resetForm(formName)
342342
this.dialogFormVisible = false

src/views/log/Log.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<aside>
4747
<p class="things" v-html="log.message"></p>
4848
<p class="brief">
49-
<span class="text-yellow">{{ log.user_name }}</span> {{ log.time | dateTimeFormatter }}
49+
<span class="text-yellow">{{ log.username }}</span> {{ log.time | dateTimeFormatter }}
5050
</p>
5151
</aside>
5252
</section>

0 commit comments

Comments
 (0)