@jx3box/jx3box-common-ui 6.3.7 → 6.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/service/cms.js +6 -1
- package/src/header/user.vue +3 -1
- package/src/upload/upload_banner.vue +3 -3
package/package.json
CHANGED
package/service/cms.js
CHANGED
|
@@ -8,4 +8,9 @@ function uploadImage(formData){
|
|
|
8
8
|
return $cms().post(`/api/cms/upload/avatar`, formData);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// 通用上传
|
|
12
|
+
function upload(formData){
|
|
13
|
+
return $cms().post(`/api/cms/upload`, formData);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { getPostAuthors, uploadImage, upload };
|
package/src/header/user.vue
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
<template v-for="(item, i) in panel">
|
|
84
84
|
<li
|
|
85
85
|
:key="'panel-' + i"
|
|
86
|
-
v-if="
|
|
86
|
+
v-if="isAdmin || !item.onlyAdmin"
|
|
87
87
|
>
|
|
88
88
|
<a :href="item.link">{{ item.label }}</a>
|
|
89
89
|
</li>
|
|
@@ -130,6 +130,7 @@ export default {
|
|
|
130
130
|
return {
|
|
131
131
|
panel,
|
|
132
132
|
isEditor: false,
|
|
133
|
+
isAdmin: false,
|
|
133
134
|
|
|
134
135
|
// 是否有消息
|
|
135
136
|
pop: false,
|
|
@@ -308,6 +309,7 @@ export default {
|
|
|
308
309
|
init: function () {
|
|
309
310
|
if (this.isLogin) {
|
|
310
311
|
this.isEditor = User.isEditor();
|
|
312
|
+
this.isAdmin = User.isAdmin();
|
|
311
313
|
this.checkMSG();
|
|
312
314
|
this.loadPanel();
|
|
313
315
|
this.loadAsset();
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<script>
|
|
23
23
|
import { getThumbnail } from "@jx3box/jx3box-common/js/utils";
|
|
24
|
-
import {
|
|
24
|
+
import { upload } from "../../service/cms.js";
|
|
25
25
|
export default {
|
|
26
26
|
name: "upload-banner",
|
|
27
27
|
props: {
|
|
@@ -93,8 +93,8 @@ export default {
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
const formData = new FormData();
|
|
96
|
-
formData.append("
|
|
97
|
-
|
|
96
|
+
formData.append("file", file);
|
|
97
|
+
upload(formData).then((res) => {
|
|
98
98
|
this.data = res.data.data[0];
|
|
99
99
|
this.$message({
|
|
100
100
|
message: "上传成功",
|