Skip to content

Upgrade to version 0.3.4 #299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ QQ群搜索:林间有风 或 643205479

## 版本日志

最新版本 `0.3.3`
最新版本 `0.3.4`

### 0.3.4

1. `U` 优化变量命名,升级 `element-ui` 版本,
2. `F` `Home` 组件改为异步加载

### 0.3.3

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lin-cms",
"version": "0.3.3",
"version": "0.3.4",
"private": true,
"scripts": {
"serve": "node script/plugin-get-config.js && vue-cli-service serve",
Expand All @@ -17,7 +17,7 @@
"@babel/polyfill": "^7.4.4",
"@tinymce/tinymce-vue": "^2.0.0",
"axios": "~0.18.0",
"element-ui": "^2.10.1",
"element-ui": "^2.13.0",
"event-source-polyfill": "^1.0.7",
"fastscan": "^1.0.4",
"good-storage": "^1.1.0",
Expand Down
209 changes: 0 additions & 209 deletions public/iconfont1.css

This file was deleted.

2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
.loader-logo {
width: 60px;
height: 98px;
height: 91px;
position: fixed;
left: 20%;
top: 43%;
Expand Down
Binary file modified public/static/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/components/layout/User.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export default {
})
.then(putRes => {
// eslint-disable-line
if (putRes.code < window.SUCCESS_CODE) {
if (putRes.code < window.MAX_SUCCESS_CODE) {
this.$message({
type: 'success',
message: '更新头像成功',
Expand Down Expand Up @@ -315,7 +315,7 @@ export default {
showBackend: true,
})
.then(res => {
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.$message({
type: 'success',
message: '更新昵称成功',
Expand Down Expand Up @@ -364,7 +364,7 @@ export default {
// eslint-disable-line
if (valid) {
const res = await User.updatePassword(this.form)
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.$message.success(`${res.message}`)
this.resetForm(formName)
this.dialogFormVisible = false
Expand Down
2 changes: 1 addition & 1 deletion src/config/global.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
window.SUCCESS_CODE = 9999
window.MAX_MAX_SUCCESS_CODE = 9998
16 changes: 8 additions & 8 deletions src/lin/models/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ export default class Admin {
this.gCount = gCount
}

async increseUpage() {
async increaseUPage() {
this.uPage += 1
}

async increseGpage() {
async increaseGPage() {
this.lPage += 1
}

async decreseUpage() {
async decreaseUPage() {
this.uPage -= 1
if (this.uPage < 0) {
this.uPage = 0
}
}

async decreseGpage() {
async decreaseGPage() {
this.lPage -= 1
if (this.lPage < 0) {
this.lPage = 0
Expand Down Expand Up @@ -53,12 +53,12 @@ export default class Admin {
}

async nextUsersPage() {
await this.increseUpage()
await this.increaseUPage()
return this.getAdminUsers({})
}

async preUsersPage() {
await this.decreseUpage()
await this.decreaseUPage()
return this.getAdminUsers({})
}

Expand All @@ -71,12 +71,12 @@ export default class Admin {
}

async nextGroupsPage() {
await this.increseGpage()
await this.increaseGPage()
return this.getGroupsWithPermissions({})
}

async preGroupsPage() {
await this.decreseGpage()
await this.decreaseGPage()
return this.getGroupsWithPermissions({})
}

Expand Down
12 changes: 6 additions & 6 deletions src/lin/models/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ class Log {
// lCount && this.lCount = lCount
}

async increseUpage() {
async increaseUpage() {
this.uPage += 1
}

async increseLpage() {
async increaseLpage() {
this.lPage += 1
}

increseSpage() {
increaseSpage() {
this.sPage += 1
}

Expand Down Expand Up @@ -149,17 +149,17 @@ class Log {
}

async moreUserPage() {
await this.increseUpage()
await this.increaseUpage()
return this.getLoggedUsers({})
}

async moreLogPage() {
await this.increseLpage()
await this.increaseLpage()
return this.getLogs({ next: true })
}

async moreSearchPage() {
this.increseSpage()
this.increaseSpage()
return this.searchLogs({ next: true })
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/router/routes.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import Home from '@/views/home/Home'
import homeRouter from './home-router'

const routes = [
{
path: '/',
name: 'Home',
redirect: '/about',
component: Home,
component: () => import('@/views/home/Home'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个块不拆分, 少一次请求, 其实也没啥问题

children: [...homeRouter],
},
{
Expand Down
7 changes: 5 additions & 2 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Vue from 'vue'
import Vuex from 'vuex'
import createLogger from 'vuex/dist/logger'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个引入是不是有点问题

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

import VuexPersistence from 'vuex-persist'
import mutations from './mutations'
import state from './state'
Expand All @@ -18,11 +19,13 @@ const vuexLocal = new VuexPersistence({
}),
})

const debug = process.env.NODE_ENV !== 'production'

export default new Vuex.Store({
state,
getters,
mutations,
actions,
plugins: [vuexLocal.plugin],
strict: process.env.NODE_ENV !== 'production',
plugins: debug ? [vuexLocal.plugin, createLogger()] : [vuexLocal.plugin],
strict: debug,
})
2 changes: 1 addition & 1 deletion src/views/admin/group/GroupAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
this.loading = false
console.log(e)
}
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.loading = false
this.$message.success(`${res.message}`)
this.eventBus.$emit('addGroup', true)
Expand Down
6 changes: 3 additions & 3 deletions src/views/admin/group/GroupList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default {
if (this.cacheForm.name !== this.form.name || this.cacheForm.info !== this.form.info) {
// eslint-disable-line
const res = await Admin.updateOneGroup(this.form.name, this.form.info, this.id)
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.$message.success(`${res.message}`)
this.getAllGroups()
}
Expand All @@ -150,7 +150,7 @@ export default {
if (deletePermissions.length > 0) {
delRes = await Admin.removePermissions(this.id, deletePermissions)
}
if (addRes.code < window.SUCCESS_CODE || delRes.code < window.SUCCESS_CODE) {
if (addRes.code < window.MAX_SUCCESS_CODE || delRes.code < window.MAX_SUCCESS_CODE) {
this.$message.success('权限修改成功')
}
}
Expand Down Expand Up @@ -191,7 +191,7 @@ export default {
this.loading = false
console.log(e)
}
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
await this.getAllGroups()
this.$message({
type: 'success',
Expand Down
4 changes: 2 additions & 2 deletions src/views/admin/user/UserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default {
try {
this.loading = true
res = await User.register(this.form)
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.loading = false
this.$message.success(`${res.message}`)
this.eventBus.$emit('addUser', true)
Expand Down Expand Up @@ -198,7 +198,7 @@ export default {
this.loading = false
console.log(e)
}
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.loading = false
this.$message.success(`${res.message}`)
this.$emit('handleInfoResult', true)
Expand Down
2 changes: 1 addition & 1 deletion src/views/admin/user/UserList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default {
this.loading = false
console.log(e)
}
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.loading = false
if (this.total_nums % this.pageCount === 1 && this.currentPage !== 1) {
// 判断删除的是不是每一页的最后一条数据
Expand Down
2 changes: 1 addition & 1 deletion src/views/admin/user/UserPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
this.loading = false
console.log(e)
}
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个写法感觉有点问题, 既然是成功失败, 判断写在通用的组件里, 应用的时候使用 try catch是不是更好一些. 也不需要在window上挂全局变量

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个写法感觉有点问题, 既然是成功失败, 判断写在通用的组件里, 应用的时候使用 try catch是不是更好一些. 也不需要在window上挂全局变量

写在通用组件里,每次使用的时候还要引入,除非挂载在 vm 实例上

this.loading = false
this.$message.success(`${res.message}`)
this.resetForm(formName)
Expand Down
2 changes: 1 addition & 1 deletion src/views/book/BookAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
async submitForm(formName) {
try {
const res = await book.addBook(this.form)
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.$message.success(`${res.message}`)
this.resetForm(formName)
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/book/BookEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
methods: {
async submitForm() {
const res = await book.editBook(this.editBookID, this.form)
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.$message.success(`${res.message}`)
this.$emit('editClose')
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/book/BookList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default {
type: 'warning',
}).then(async () => {
const res = await book.delectBook(val.row.id)
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.getBooks()
this.$message({
type: 'success',
Expand Down
6 changes: 3 additions & 3 deletions src/views/center/Center.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default {
})
.then(putRes => {
// eslint-disable-line
if (putRes.code < window.SUCCESS_CODE) {
if (putRes.code < window.MAX_SUCCESS_CODE) {
this.$message({
type: 'success',
message: '更新头像成功',
Expand Down Expand Up @@ -298,7 +298,7 @@ export default {
showBackend: true,
})
.then(res => {
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.$message({
type: 'success',
message: '更新昵称成功',
Expand Down Expand Up @@ -336,7 +336,7 @@ export default {
// eslint-disable-line
if (valid) {
const res = await User.updatePassword(this.form)
if (res.code < window.SUCCESS_CODE) {
if (res.code < window.MAX_SUCCESS_CODE) {
this.$message.success(`${res.message}`)
this.resetForm(formName)
this.dialogFormVisible = false
Expand Down
2 changes: 1 addition & 1 deletion src/views/log/Log.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<aside>
<p class="things" v-html="log.message"></p>
<p class="brief">
<span class="text-yellow">{{ log.user_name }}</span> {{ log.time | dateTimeFormatter }}
<span class="text-yellow">{{ log.username }}</span> {{ log.time | dateTimeFormatter }}
</p>
</aside>
</section>
Expand Down