diff --git a/src/assets/wangeditor.css b/src/assets/wangeditor.css
new file mode 100644
index 0000000..4c65ba3
--- /dev/null
+++ b/src/assets/wangeditor.css
@@ -0,0 +1,52 @@
+.editor-content-view {
+ border: 3px solid #ccc;
+ border-radius: 5px;
+ padding: 0 10px;
+ margin-top: 20px;
+ overflow-x: auto;
+}
+
+.editor-content-view p,
+.editor-content-view li {
+ white-space: pre-wrap; /* 保留空格 */
+}
+
+.editor-content-view blockquote {
+ border-left: 8px solid #d0e5f2;
+ padding: 10px 10px;
+ margin: 10px 0;
+ background-color: #f1f1f1;
+}
+
+.editor-content-view code {
+ font-family: monospace;
+ background-color: #eee;
+ padding: 3px;
+ border-radius: 3px;
+}
+.editor-content-view pre>code {
+ display: block;
+ padding: 10px;
+}
+
+.editor-content-view table {
+ border-collapse: collapse;
+}
+.editor-content-view td,
+.editor-content-view th {
+ border: 1px solid #ccc;
+ min-width: 50px;
+ height: 20px;
+}
+.editor-content-view th {
+ background-color: #f1f1f1;
+}
+
+.editor-content-view ul,
+.editor-content-view ol {
+ padding-left: 20px;
+}
+
+.editor-content-view input[type="checkbox"] {
+ margin-right: 5px;
+}
\ No newline at end of file
diff --git a/src/components/RichTextEditor.vue b/src/components/RichTextEditor.vue
index 5affc38..2d0cf71 100644
--- a/src/components/RichTextEditor.vue
+++ b/src/components/RichTextEditor.vue
@@ -52,7 +52,7 @@ const mode = 'default' // 或 'simple'
// 工具栏配置
const toolbarConfig = {
excludeKeys: [
- 'group-video', // 排除视频
+ // 'group-video', // 排除视频
'fullScreen' // 排除全屏
]
}
@@ -63,26 +63,47 @@ const editorConfig = {
MENU_CONF: {
// 配置上传图片
uploadImage: {
- server: '/api/upload/image',
+ server: '/mid/upload/image',
fieldName: 'file',
meta: {
token: localStorage.getItem('token') || ''
},
metaWithUrl: false,
headers: {
- 'Authorization': `Bearer ${localStorage.getItem('token') || ''}`
+ 'Authorization': `Bearer ${localStorage.getItem('admin_token') || ''}`
},
maxFileSize: 5 * 1024 * 1024, // 5M
allowedFileTypes: ['image/*'],
customInsert(res, insertFn) {
// 自定义插入图片
- if (res.code === 200) {
+ if (res.success) {
insertFn(res.data.url, res.data.alt || '', res.data.url)
} else {
console.error('图片上传失败:', res.message)
}
}
},
+ uploadVideo: {
+ server: '/mid/upload',
+ fieldName: 'file',
+ meta: {
+ token: localStorage.getItem('token') || ''
+ },
+ metaWithUrl: false,
+ headers: {
+ 'Authorization': `Bearer ${localStorage.getItem('admin_token') || ''}`
+ },
+ maxFileSize: 20 * 1024 * 1024,
+ allowedFileTypes: ['video/*'],
+ customInsert(res, insertFn) {
+ // 自定义插入视频
+ if (res.success) {
+ insertFn(res.data.url, res.data.alt || '', res.data.url)
+ } else {
+ console.error('视频上传失败:', res.message)
+ }
+ }
+ },
// 配置字体
fontSize: {
fontSizeList: [
diff --git a/src/views/Program.vue b/src/views/Program.vue
index 321e0af..5096b3d 100644
--- a/src/views/Program.vue
+++ b/src/views/Program.vue
@@ -87,7 +87,7 @@
-
+
-
+
+
+ 详情
+
+
@@ -166,7 +170,7 @@
-
+
@@ -196,7 +200,7 @@
-
+
@@ -207,10 +211,17 @@
+
+
+
+
+
-