Skip to content

Commit de5c49d

Browse files
authored
Merge pull request #238 from TaleLin/develop
Develop
2 parents d32068b + d49c027 commit de5c49d

File tree

31 files changed

+8088
-7403
lines changed

31 files changed

+8088
-7403
lines changed

.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://localhost:5000/'
3+
VUE_APP_BASE_URL = 'http://localhost:5000/'

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module.exports = {
1313
rules: {
1414
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1515
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
16-
'linebreak-style': [0, 'error', 'windows'],
1716
'import/extensions': 0, // import不需要写文件扩展名
1817
'import/no-unresolved': 0,
1918
// 'import/no-duplicates': 0,

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,17 @@ QQ群搜索:林间有风 或 643205479
8989

9090
## 版本日志
9191

92-
最新版本 `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字段(需后端同步修改)
93103

94104
### 0.2.0
95105

package-lock.json

Lines changed: 7535 additions & 7178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
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",
1313
"test:unit": "vue-cli-service test:unit"
1414
},
1515
"dependencies": {
16-
"@babel/polyfill": "^7.2.5",
16+
"@babel/polyfill": "^7.4.4",
1717
"@tinymce/tinymce-vue": "^2.1.0",
1818
"axios": "~0.18.0",
19-
"element-ui": "^2.8.2",
20-
"event-source-polyfill": "^0.0.16",
19+
"element-ui": "^2.10.1",
20+
"event-source-polyfill": "^1.0.7",
2121
"fastscan": "^1.0.4",
2222
"good-storage": "^1.1.0",
2323
"js-cookie": "^2.2.0",
2424
"lodash": "^4.17.14",
2525
"moment": "^2.24.0",
2626
"photoswipe": "^4.1.2",
2727
"screenfull": "^4.2.0",
28-
"tinymce": "^5.0.9",
29-
"vue": "^2.6.8",
28+
"tinymce": "^5.0.12",
29+
"vue": "^2.6.10",
3030
"vue-awesome-swiper": "^3.1.3",
3131
"vue-croppa": "^1.3.8",
32-
"vue-router": "~3.0.1",
33-
"vuex": "~3.0.1",
34-
"vuex-persist": "^2.0.0"
32+
"vue-router": "^3.0.7",
33+
"vuex": "^3.1.1",
34+
"vuex-persist": "^2.0.1"
3535
},
3636
"devDependencies": {
37-
"@vue/cli-plugin-babel": "^3.4.0",
38-
"@vue/cli-plugin-eslint": "^3.4.0",
39-
"@vue/cli-plugin-unit-jest": "^3.7.0",
40-
"@vue/cli-service": "^3.4.0",
41-
"@vue/eslint-config-airbnb": "^4.0.0",
37+
"@vue/cli-plugin-babel": "^3.9.2",
38+
"@vue/cli-plugin-eslint": "^3.9.2",
39+
"@vue/cli-plugin-unit-jest": "^3.9.0",
40+
"@vue/cli-service": "^3.9.2",
41+
"@vue/eslint-config-airbnb": "^4.0.1",
4242
"@vue/test-utils": "1.0.0-beta.29",
4343
"babel-core": "7.0.0-bridge.0",
44-
"babel-eslint": "^10.0.1",
45-
"babel-jest": "^23.6.0",
44+
"babel-eslint": "^10.0.2",
45+
"babel-jest": "^24.8.0",
4646
"babel-plugin-component": "^1.1.1",
4747
"chalk": "^2.4.2",
4848
"child_process": "^1.0.2",
4949
"cz-conventional-changelog": "^2.1.0",
50-
"directory-tree": "^2.2.1",
51-
"ejs": "^2.6.1",
52-
"eslint": "^5.8.0",
53-
"eslint-plugin-vue": "^5.0.0",
54-
"fs-extra": "^7.0.1",
55-
"inquirer": "^6.2.2",
56-
"js-yaml": "^3.12.2",
50+
"directory-tree": "^2.2.3",
51+
"ejs": "^2.6.2",
52+
"eslint": "^6.0.1",
53+
"eslint-plugin-vue": "^5.2.3",
54+
"fs-extra": "^8.1.0",
55+
"inquirer": "^6.5.0",
56+
"js-yaml": "^3.13.1",
5757
"node-sass": "^4.12.0",
5858
"sass-loader": "^7.1.0",
59-
"semver": "^5.6.0",
59+
"semver": "^6.2.0",
6060
"shelljs": "^0.8.3",
6161
"validate-npm-package-name": "^3.0.0",
6262
"vue-markdown-loader": "^2.4.1",
63-
"vue-template-compiler": "^2.6.8",
63+
"vue-template-compiler": "^2.6.10",
6464
"yaml-front-matter": "^4.0.0"
6565
},
6666
"postcss": {

public/iconfont.css

Lines changed: 14 additions & 6 deletions
Large diffs are not rendered by default.

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/assets/styles/realize/lin-variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$theme: #3963bc;
22

33
/* 布局 */
4-
$sidebar-width: 175px;
4+
$sidebar-width: 190px;
55
$sidebar-background: #192a5e;
66

77
$navbar-height: 30px;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// eslint-disable-next-line
2+
const importAll = (requireContext) => requireContext.keys().forEach(requireContext)
3+
try {
4+
// 导入所有插件
5+
importAll(require.context('../../../../node_modules/tinymce/plugins', true))
6+
} catch (err) {
7+
console.log(err)
8+
}

src/components/base/tinymce/index.vue

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,12 @@
33
<editor id="tinymceEditor" :init="tinymceInit" v-model="content" :key="tinymceFlag"></editor>
44
</div>
55
</template>
6-
76
<script>
87
// eslint-disable-next-line
98
import tinymce from 'tinymce/tinymce'
109
import Editor from '@tinymce/tinymce-vue'
1110
import 'tinymce/themes/silver/theme'
12-
import 'tinymce/plugins/textcolor'
13-
import 'tinymce/plugins/advlist'
14-
import 'tinymce/plugins/table'
15-
import 'tinymce/plugins/lists'
16-
import 'tinymce/plugins/paste'
17-
import 'tinymce/plugins/preview'
18-
import 'tinymce/plugins/fullscreen'
19-
import 'tinymce/plugins/image'
20-
import 'tinymce/plugins/code'
21-
import 'tinymce/plugins/link'
11+
import './importAll'
2212
2313
export default {
2414
name: 'TinymceEditor',
@@ -39,6 +29,11 @@ export default {
3929
type: Boolean,
4030
default: true,
4131
},
32+
toolbar: {
33+
type: String,
34+
// eslint-disable-next-line
35+
default: ' undo redo |formatselect | bold italic strikethrough forecolor backcolor formatpainter | link image | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | preview fullscreen code',
36+
},
4237
},
4338
components: {
4439
Editor,
@@ -64,32 +59,25 @@ export default {
6459
statusbar: false, // 隐藏编辑器底部的状态栏
6560
paste_data_images: true, // 允许粘贴图像
6661
menubar: this.showMenubar, // 隐藏最上方menu
67-
plugins: 'advlist table lists paste preview fullscreen image code link',
6862
// eslint-disable-next-line
69-
toolbar:' undo redo |fontselect fontsizeselect forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | link image | h1 h2 h3 blockquote table numlist bullist | preview fullscreen code',
63+
plugins: 'print fullpage searchreplace autolink directionality visualblocks visualchars template codesample charmap hr pagebreak nonbreaking anchor toc insertdatetime wordcount textpattern help advlist table lists paste preview fullscreen image imagetools code link',
64+
toolbar: this.toolbar,
7065
// eslint-disable-next-line
7166
images_upload_handler: async function(blobInfo, success, failure) {
72-
// eslint-disable-next-line
73-
let json
74-
const xhr = new XMLHttpRequest()
75-
xhr.withCredentials = false
76-
xhr.open('POST', `${_this.upload_url}`)
77-
// eslint-disable-next-line
78-
xhr.onload = function() {
79-
if (xhr.status !== 200) {
80-
failure(`HTTP Error: ${xhr.status}`)
81-
return
82-
}
83-
json = JSON.parse(xhr.responseText)
84-
if (json[0] && json[0].url) {
85-
success(json[0].url)
86-
} else {
87-
failure(`Invalid JSON: ${xhr.responseText}`)
67+
const file = new File([blobInfo.blob()], blobInfo.filename(), {
68+
type: 'image/*',
69+
})
70+
_this.$axios({
71+
method: 'post',
72+
url: '/cms/file',
73+
data: {
74+
file,
75+
},
76+
}).then((res) => {
77+
if (res[0] && res[0].url) {
78+
success(res[0].url)
8879
}
89-
}
90-
const formData = new FormData()
91-
formData.append('file', blobInfo.blob(), blobInfo.filename())
92-
xhr.send(formData)
80+
}).catch(err => failure(err))
9381
},
9482
}
9583
},

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/ClearTab.vue

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<template>
2+
<div title="关闭全部历史记录" class="tab" @click="closeReuseTab">
3+
<i class="iconfont icon-moshubang"></i>
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: 'CloseTab',
10+
inject: ['eventBus'],
11+
methods: {
12+
closeReuseTab() {
13+
this.eventBus.$emit('clearTap')
14+
},
15+
},
16+
}
17+
</script>
18+
19+
<style lang="scss" scoped>
20+
.tab {
21+
cursor: pointer;
22+
margin-right: 10px;
23+
i {
24+
width: 40px;
25+
height: 40px;
26+
font-size: 20px;
27+
}
28+
}
29+
</style>

src/components/layout/NavBar.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<!-- 暂时放这里 -->
88
<div class="right-info">
99
<notify v-auth="'消息推送'" v-show="false" />
10+
<clear-tab></clear-tab>
1011
<screenfull />
1112
<user></user>
1213
</div>
@@ -19,6 +20,7 @@ import Notify from '@/components/notify/notify'
1920
import Breadcrumb from './Breadcrumb'
2021
import Screenfull from './Screenfull'
2122
import User from './User'
23+
import ClearTab from './ClearTab'
2224
2325
export default {
2426
name: 'NavBar',
@@ -28,6 +30,7 @@ export default {
2830
User,
2931
Notify,
3032
Screenfull,
33+
ClearTab,
3134
},
3235
}
3336
</script>

src/components/layout/ReuseTab.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export default {
9797
},
9898
mounted() {
9999
this.init()
100+
this.eventBus.$on('clearTap', () => {
101+
this.histories = []
102+
})
100103
},
101104
methods: {
102105
init() {

src/components/layout/Screenfull.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="container">
2+
<div class="container" title="全屏/正常">
33
<i class="iconfont" :class="isFullscreen?'icon-quxiaoquanping':'icon-quanping'" @click="handleFullScreen"></i>
44
</div>
55
</template>

0 commit comments

Comments
 (0)