Преглед изворни кода

更新投稿页面, 添加图片和文章投稿

reghao пре 3 година
родитељ
комит
0504994cbb

+ 156 - 65
package-lock.json

@@ -9,6 +9,7 @@
       "version": "1.0.0",
       "dependencies": {
         "@liripeng/vue-audio-player": "^1.5.0",
+        "@tinymce/tinymce-vue": "^3.0.1",
         "core-js": "^3.6.5",
         "crypto-js": "^4.1.1",
         "dashjs": "^4.2.0",
@@ -25,11 +26,13 @@
         "js-cookie": "2.2.0",
         "jsencrypt": "^3.2.1",
         "shaka-player": "^3.2.1",
+        "tinymce": "^5.1.0",
         "v-viewer": "^1.6.4",
         "vue": "^2.6.12",
         "vue-cookies": "^1.7.4",
         "vue-filepond": "^6.0.3",
         "vue-infinite-scroll": "^2.0.2",
+        "vue-quill-editor": "^3.0.6",
         "vue-router": "^3.4.5",
         "vue-simple-uploader": "^0.7.6",
         "vuetify": "^2.3.12",
@@ -1739,6 +1742,14 @@
       "integrity": "sha1-pTUV2yXYA4N0OBtzryC7Ty5QjYc=",
       "dev": true
     },
+    "node_modules/@tinymce/tinymce-vue": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmmirror.com/@tinymce/tinymce-vue/-/tinymce-vue-3.0.1.tgz",
+      "integrity": "sha512-UnS1YTmzlASA/G23v8zZFgmjR34BSzMkYDSkGOe4ZqWDkz2uwHmiC1sNQj/70DVWG9br8cTPVjUhgOn/b+3ygQ==",
+      "peerDependencies": {
+        "vue": "^2.4.3"
+      }
+    },
     "node_modules/@types/anymatch": {
       "version": "1.3.1",
       "resolved": "https://registry.npm.taobao.org/@types/anymatch/download/@types/anymatch-1.3.1.tgz?cache=0&sync_timestamp=1596837910096&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fanymatch%2Fdownload%2F%40types%2Fanymatch-1.3.1.tgz",
@@ -5496,7 +5507,6 @@
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/deep-equal/download/deep-equal-1.1.1.tgz",
       "integrity": "sha1-tcmMlCzv+vfLBR4k4UNKJaLmB2o=",
-      "dev": true,
       "dependencies": {
         "is-arguments": "^1.0.4",
         "is-date-object": "^1.0.1",
@@ -5688,7 +5698,6 @@
       "version": "1.1.3",
       "resolved": "https://registry.npm.taobao.org/define-properties/download/define-properties-1.1.3.tgz",
       "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=",
-      "dev": true,
       "dependencies": {
         "object-keys": "^1.0.12"
       },
@@ -6211,7 +6220,6 @@
       "version": "1.18.0-next.0",
       "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.18.0-next.0.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.18.0-next.0.tgz",
       "integrity": "sha1-swKDSSfmJNjlg37UgiQpHyxm5vw=",
-      "dev": true,
       "dependencies": {
         "es-to-primitive": "^1.2.1",
         "function-bind": "^1.1.1",
@@ -6234,7 +6242,6 @@
       "version": "1.2.1",
       "resolved": "https://registry.npm.taobao.org/es-to-primitive/download/es-to-primitive-1.2.1.tgz",
       "integrity": "sha1-5VzUyc3BiLzvsDs2bHNjI/xciYo=",
-      "dev": true,
       "dependencies": {
         "is-callable": "^1.1.4",
         "is-date-object": "^1.0.1",
@@ -6778,8 +6785,7 @@
     "node_modules/extend": {
       "version": "3.0.2",
       "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
-      "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=",
-      "dev": true
+      "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
     },
     "node_modules/extend-shallow": {
       "version": "3.0.2",
@@ -6916,6 +6922,11 @@
       "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=",
       "dev": true
     },
+    "node_modules/fast-diff": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/fast-diff/-/fast-diff-1.1.2.tgz",
+      "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="
+    },
     "node_modules/fast-glob": {
       "version": "2.2.7",
       "resolved": "https://registry.npm.taobao.org/fast-glob/download/fast-glob-2.2.7.tgz?cache=0&sync_timestamp=1592290280465&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-glob%2Fdownload%2Ffast-glob-2.2.7.tgz",
@@ -7366,8 +7377,7 @@
     "node_modules/function-bind": {
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz",
-      "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=",
-      "dev": true
+      "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0="
     },
     "node_modules/functional-red-black-tree": {
       "version": "1.0.1",
@@ -7538,7 +7548,6 @@
       "version": "1.0.3",
       "resolved": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz",
       "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=",
-      "dev": true,
       "dependencies": {
         "function-bind": "^1.1.1"
       },
@@ -7580,7 +7589,6 @@
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.1.tgz",
       "integrity": "sha1-n1IUdYpEGWxAbZvXbOv4HsLdMeg=",
-      "dev": true,
       "engines": {
         "node": ">= 0.4"
       }
@@ -8395,7 +8403,6 @@
       "version": "1.0.4",
       "resolved": "https://registry.npm.taobao.org/is-arguments/download/is-arguments-1.0.4.tgz",
       "integrity": "sha1-P6+WbHy6D/Q3+zH2JQCC/PBEjPM=",
-      "dev": true,
       "engines": {
         "node": ">= 0.4"
       }
@@ -8428,7 +8435,6 @@
       "version": "1.2.2",
       "resolved": "https://registry.npm.taobao.org/is-callable/download/is-callable-1.2.2.tgz?cache=0&sync_timestamp=1600719276620&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-callable%2Fdownload%2Fis-callable-1.2.2.tgz",
       "integrity": "sha1-x8ZxXNItTdtI0+GZcCI6zquwgNk=",
-      "dev": true,
       "engines": {
         "node": ">= 0.4"
       }
@@ -8487,7 +8493,6 @@
       "version": "1.0.2",
       "resolved": "https://registry.npm.taobao.org/is-date-object/download/is-date-object-1.0.2.tgz",
       "integrity": "sha1-vac28s2P0G0yhE53Q7+nSUw7/X4=",
-      "dev": true,
       "engines": {
         "node": ">= 0.4"
       }
@@ -8579,7 +8584,6 @@
       "version": "2.0.0",
       "resolved": "https://registry.npm.taobao.org/is-negative-zero/download/is-negative-zero-2.0.0.tgz",
       "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=",
-      "dev": true,
       "engines": {
         "node": ">= 0.4"
       }
@@ -8675,7 +8679,6 @@
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/is-regex/download/is-regex-1.1.1.tgz?cache=0&sync_timestamp=1596555746435&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-regex%2Fdownload%2Fis-regex-1.1.1.tgz",
       "integrity": "sha1-xvmKrMVG9s7FRooHt7FTq1ZKV7k=",
-      "dev": true,
       "dependencies": {
         "has-symbols": "^1.0.1"
       },
@@ -8714,7 +8717,6 @@
       "version": "1.0.3",
       "resolved": "https://registry.npm.taobao.org/is-symbol/download/is-symbol-1.0.3.tgz",
       "integrity": "sha1-OOEBS55jKb4N6dJKQU/XRB7GGTc=",
-      "dev": true,
       "dependencies": {
         "has-symbols": "^1.0.1"
       },
@@ -9963,7 +9965,6 @@
       "version": "4.1.1",
       "resolved": "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz",
       "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
-      "dev": true,
       "engines": {
         "node": ">=0.10.0"
       }
@@ -10018,14 +10019,12 @@
     "node_modules/object-inspect": {
       "version": "1.8.0",
       "resolved": "https://registry.npm.taobao.org/object-inspect/download/object-inspect-1.8.0.tgz?cache=0&sync_timestamp=1592545152574&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-inspect%2Fdownload%2Fobject-inspect-1.8.0.tgz",
-      "integrity": "sha1-34B+Xs9TpgnMa/6T6sPMe+WzqdA=",
-      "dev": true
+      "integrity": "sha1-34B+Xs9TpgnMa/6T6sPMe+WzqdA="
     },
     "node_modules/object-is": {
       "version": "1.1.2",
       "resolved": "https://registry.npm.taobao.org/object-is/download/object-is-1.1.2.tgz?cache=0&sync_timestamp=1586894009620&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-is%2Fdownload%2Fobject-is-1.1.2.tgz",
       "integrity": "sha1-xdLof/nhGfeLegiEQVGeLuwVc7Y=",
-      "dev": true,
       "dependencies": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.5"
@@ -10038,7 +10037,6 @@
       "version": "1.17.6",
       "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.6.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.6.tgz",
       "integrity": "sha1-kUIHFweFeyysx7iey2cDFsPi1So=",
-      "dev": true,
       "dependencies": {
         "es-to-primitive": "^1.2.1",
         "function-bind": "^1.1.1",
@@ -10060,7 +10058,6 @@
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/object-keys/download/object-keys-1.1.1.tgz",
       "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=",
-      "dev": true,
       "engines": {
         "node": ">= 0.4"
       }
@@ -10081,7 +10078,6 @@
       "version": "4.1.1",
       "resolved": "https://registry.npm.taobao.org/object.assign/download/object.assign-4.1.1.tgz?cache=0&sync_timestamp=1599844895115&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.assign%2Fdownload%2Fobject.assign-4.1.1.tgz",
       "integrity": "sha1-MDhnpmbN1Bk27N7fsfjz4ypHjN0=",
-      "dev": true,
       "dependencies": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.18.0-next.0",
@@ -10419,6 +10415,11 @@
         "no-case": "^2.2.0"
       }
     },
+    "node_modules/parchment": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmmirror.com/parchment/-/parchment-1.1.4.tgz",
+      "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="
+    },
     "node_modules/parent-module": {
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/parent-module/download/parent-module-1.0.1.tgz",
@@ -11577,6 +11578,45 @@
       "integrity": "sha1-M0WUG0FTy50ILY7uTNogFqmu9/Y=",
       "dev": true
     },
+    "node_modules/quill": {
+      "version": "1.3.7",
+      "resolved": "https://registry.npmmirror.com/quill/-/quill-1.3.7.tgz",
+      "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
+      "dependencies": {
+        "clone": "^2.1.1",
+        "deep-equal": "^1.0.1",
+        "eventemitter3": "^2.0.3",
+        "extend": "^3.0.2",
+        "parchment": "^1.1.4",
+        "quill-delta": "^3.6.2"
+      }
+    },
+    "node_modules/quill-delta": {
+      "version": "3.6.3",
+      "resolved": "https://registry.npmmirror.com/quill-delta/-/quill-delta-3.6.3.tgz",
+      "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
+      "dependencies": {
+        "deep-equal": "^1.0.1",
+        "extend": "^3.0.2",
+        "fast-diff": "1.1.2"
+      },
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/quill/node_modules/clone": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmmirror.com/clone/-/clone-2.1.2.tgz",
+      "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/quill/node_modules/eventemitter3": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-2.0.3.tgz",
+      "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="
+    },
     "node_modules/randombytes": {
       "version": "2.1.0",
       "resolved": "https://registry.npm.taobao.org/randombytes/download/randombytes-2.1.0.tgz",
@@ -11724,7 +11764,6 @@
       "version": "1.3.0",
       "resolved": "https://registry.npm.taobao.org/regexp.prototype.flags/download/regexp.prototype.flags-1.3.0.tgz",
       "integrity": "sha1-erqJs8E6ZFCdq888qNn7ub31y3U=",
-      "dev": true,
       "dependencies": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.0-next.1"
@@ -11737,7 +11776,6 @@
       "version": "1.17.6",
       "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.6.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.6.tgz",
       "integrity": "sha1-kUIHFweFeyysx7iey2cDFsPi1So=",
-      "dev": true,
       "dependencies": {
         "es-to-primitive": "^1.2.1",
         "function-bind": "^1.1.1",
@@ -13069,7 +13107,6 @@
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/string.prototype.trimend/download/string.prototype.trimend-1.0.1.tgz?cache=0&sync_timestamp=1586465233837&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimend%2Fdownload%2Fstring.prototype.trimend-1.0.1.tgz",
       "integrity": "sha1-hYEqa4R6wAInD1gIFGBkyZX7aRM=",
-      "dev": true,
       "dependencies": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.5"
@@ -13079,7 +13116,6 @@
       "version": "1.17.6",
       "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.6.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.6.tgz",
       "integrity": "sha1-kUIHFweFeyysx7iey2cDFsPi1So=",
-      "dev": true,
       "dependencies": {
         "es-to-primitive": "^1.2.1",
         "function-bind": "^1.1.1",
@@ -13101,7 +13137,6 @@
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/string.prototype.trimstart/download/string.prototype.trimstart-1.0.1.tgz?cache=0&sync_timestamp=1586465234129&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimstart%2Fdownload%2Fstring.prototype.trimstart-1.0.1.tgz",
       "integrity": "sha1-FK9tnzSwU/fPyJty+PLuFLkDmlQ=",
-      "dev": true,
       "dependencies": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.5"
@@ -13111,7 +13146,6 @@
       "version": "1.17.6",
       "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.6.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.6.tgz",
       "integrity": "sha1-kUIHFweFeyysx7iey2cDFsPi1So=",
-      "dev": true,
       "dependencies": {
         "es-to-primitive": "^1.2.1",
         "function-bind": "^1.1.1",
@@ -13489,6 +13523,11 @@
       "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
       "dev": true
     },
+    "node_modules/tinymce": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmmirror.com/tinymce/-/tinymce-5.1.0.tgz",
+      "integrity": "sha512-zprr8gLHNCxxT4ebgwwIg1erhxQs1GUb3YHgNlRAuGRButDsrn35e1HW9YtMli/AnuY+ECcqyqhEI/wUNMYEFw=="
+    },
     "node_modules/tmp": {
       "version": "0.0.33",
       "resolved": "https://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz",
@@ -14238,6 +14277,19 @@
       "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=",
       "dev": true
     },
+    "node_modules/vue-quill-editor": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmmirror.com/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz",
+      "integrity": "sha512-g20oSZNWg8Hbu41Kinjd55e235qVWPLfg4NvsLW6d+DhgBTFbEuMpcWlUdrD6qT3+Noim6DRu18VLM9lVShXOQ==",
+      "dependencies": {
+        "object-assign": "^4.1.1",
+        "quill": "^1.3.4"
+      },
+      "engines": {
+        "node": ">= 4.0.0",
+        "npm": ">= 3.0.0"
+      }
+    },
     "node_modules/vue-router": {
       "version": "3.4.5",
       "resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.4.5.tgz?cache=0&sync_timestamp=1601130992163&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.4.5.tgz",
@@ -16842,6 +16894,12 @@
       "integrity": "sha1-pTUV2yXYA4N0OBtzryC7Ty5QjYc=",
       "dev": true
     },
+    "@tinymce/tinymce-vue": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmmirror.com/@tinymce/tinymce-vue/-/tinymce-vue-3.0.1.tgz",
+      "integrity": "sha512-UnS1YTmzlASA/G23v8zZFgmjR34BSzMkYDSkGOe4ZqWDkz2uwHmiC1sNQj/70DVWG9br8cTPVjUhgOn/b+3ygQ==",
+      "requires": {}
+    },
     "@types/anymatch": {
       "version": "1.3.1",
       "resolved": "https://registry.npm.taobao.org/@types/anymatch/download/@types/anymatch-1.3.1.tgz?cache=0&sync_timestamp=1596837910096&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fanymatch%2Fdownload%2F%40types%2Fanymatch-1.3.1.tgz",
@@ -20059,7 +20117,6 @@
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/deep-equal/download/deep-equal-1.1.1.tgz",
       "integrity": "sha1-tcmMlCzv+vfLBR4k4UNKJaLmB2o=",
-      "dev": true,
       "requires": {
         "is-arguments": "^1.0.4",
         "is-date-object": "^1.0.1",
@@ -20208,7 +20265,6 @@
       "version": "1.1.3",
       "resolved": "https://registry.npm.taobao.org/define-properties/download/define-properties-1.1.3.tgz",
       "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=",
-      "dev": true,
       "requires": {
         "object-keys": "^1.0.12"
       }
@@ -20670,7 +20726,6 @@
       "version": "1.18.0-next.0",
       "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.18.0-next.0.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.18.0-next.0.tgz",
       "integrity": "sha1-swKDSSfmJNjlg37UgiQpHyxm5vw=",
-      "dev": true,
       "requires": {
         "es-to-primitive": "^1.2.1",
         "function-bind": "^1.1.1",
@@ -20690,7 +20745,6 @@
       "version": "1.2.1",
       "resolved": "https://registry.npm.taobao.org/es-to-primitive/download/es-to-primitive-1.2.1.tgz",
       "integrity": "sha1-5VzUyc3BiLzvsDs2bHNjI/xciYo=",
-      "dev": true,
       "requires": {
         "is-callable": "^1.1.4",
         "is-date-object": "^1.0.1",
@@ -21126,8 +21180,7 @@
     "extend": {
       "version": "3.0.2",
       "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
-      "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=",
-      "dev": true
+      "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
     },
     "extend-shallow": {
       "version": "3.0.2",
@@ -21238,6 +21291,11 @@
       "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=",
       "dev": true
     },
+    "fast-diff": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/fast-diff/-/fast-diff-1.1.2.tgz",
+      "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="
+    },
     "fast-glob": {
       "version": "2.2.7",
       "resolved": "https://registry.npm.taobao.org/fast-glob/download/fast-glob-2.2.7.tgz?cache=0&sync_timestamp=1592290280465&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-glob%2Fdownload%2Ffast-glob-2.2.7.tgz",
@@ -21608,8 +21666,7 @@
     "function-bind": {
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz",
-      "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=",
-      "dev": true
+      "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0="
     },
     "functional-red-black-tree": {
       "version": "1.0.1",
@@ -21746,7 +21803,6 @@
       "version": "1.0.3",
       "resolved": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz",
       "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=",
-      "dev": true,
       "requires": {
         "function-bind": "^1.1.1"
       }
@@ -21777,8 +21833,7 @@
     "has-symbols": {
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.1.tgz",
-      "integrity": "sha1-n1IUdYpEGWxAbZvXbOv4HsLdMeg=",
-      "dev": true
+      "integrity": "sha1-n1IUdYpEGWxAbZvXbOv4HsLdMeg="
     },
     "has-value": {
       "version": "1.0.0",
@@ -22456,8 +22511,7 @@
     "is-arguments": {
       "version": "1.0.4",
       "resolved": "https://registry.npm.taobao.org/is-arguments/download/is-arguments-1.0.4.tgz",
-      "integrity": "sha1-P6+WbHy6D/Q3+zH2JQCC/PBEjPM=",
-      "dev": true
+      "integrity": "sha1-P6+WbHy6D/Q3+zH2JQCC/PBEjPM="
     },
     "is-arrayish": {
       "version": "0.2.1",
@@ -22483,8 +22537,7 @@
     "is-callable": {
       "version": "1.2.2",
       "resolved": "https://registry.npm.taobao.org/is-callable/download/is-callable-1.2.2.tgz?cache=0&sync_timestamp=1600719276620&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-callable%2Fdownload%2Fis-callable-1.2.2.tgz",
-      "integrity": "sha1-x8ZxXNItTdtI0+GZcCI6zquwgNk=",
-      "dev": true
+      "integrity": "sha1-x8ZxXNItTdtI0+GZcCI6zquwgNk="
     },
     "is-ci": {
       "version": "1.2.1",
@@ -22532,8 +22585,7 @@
     "is-date-object": {
       "version": "1.0.2",
       "resolved": "https://registry.npm.taobao.org/is-date-object/download/is-date-object-1.0.2.tgz",
-      "integrity": "sha1-vac28s2P0G0yhE53Q7+nSUw7/X4=",
-      "dev": true
+      "integrity": "sha1-vac28s2P0G0yhE53Q7+nSUw7/X4="
     },
     "is-descriptor": {
       "version": "0.1.6",
@@ -22596,8 +22648,7 @@
     "is-negative-zero": {
       "version": "2.0.0",
       "resolved": "https://registry.npm.taobao.org/is-negative-zero/download/is-negative-zero-2.0.0.tgz",
-      "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=",
-      "dev": true
+      "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE="
     },
     "is-number": {
       "version": "3.0.0",
@@ -22668,7 +22719,6 @@
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/is-regex/download/is-regex-1.1.1.tgz?cache=0&sync_timestamp=1596555746435&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-regex%2Fdownload%2Fis-regex-1.1.1.tgz",
       "integrity": "sha1-xvmKrMVG9s7FRooHt7FTq1ZKV7k=",
-      "dev": true,
       "requires": {
         "has-symbols": "^1.0.1"
       }
@@ -22698,7 +22748,6 @@
       "version": "1.0.3",
       "resolved": "https://registry.npm.taobao.org/is-symbol/download/is-symbol-1.0.3.tgz",
       "integrity": "sha1-OOEBS55jKb4N6dJKQU/XRB7GGTc=",
-      "dev": true,
       "requires": {
         "has-symbols": "^1.0.1"
       }
@@ -23750,8 +23799,7 @@
     "object-assign": {
       "version": "4.1.1",
       "resolved": "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz",
-      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
-      "dev": true
+      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
     },
     "object-copy": {
       "version": "0.1.0",
@@ -23793,14 +23841,12 @@
     "object-inspect": {
       "version": "1.8.0",
       "resolved": "https://registry.npm.taobao.org/object-inspect/download/object-inspect-1.8.0.tgz?cache=0&sync_timestamp=1592545152574&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-inspect%2Fdownload%2Fobject-inspect-1.8.0.tgz",
-      "integrity": "sha1-34B+Xs9TpgnMa/6T6sPMe+WzqdA=",
-      "dev": true
+      "integrity": "sha1-34B+Xs9TpgnMa/6T6sPMe+WzqdA="
     },
     "object-is": {
       "version": "1.1.2",
       "resolved": "https://registry.npm.taobao.org/object-is/download/object-is-1.1.2.tgz?cache=0&sync_timestamp=1586894009620&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-is%2Fdownload%2Fobject-is-1.1.2.tgz",
       "integrity": "sha1-xdLof/nhGfeLegiEQVGeLuwVc7Y=",
-      "dev": true,
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.5"
@@ -23810,7 +23856,6 @@
           "version": "1.17.6",
           "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.6.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.6.tgz",
           "integrity": "sha1-kUIHFweFeyysx7iey2cDFsPi1So=",
-          "dev": true,
           "requires": {
             "es-to-primitive": "^1.2.1",
             "function-bind": "^1.1.1",
@@ -23830,8 +23875,7 @@
     "object-keys": {
       "version": "1.1.1",
       "resolved": "https://registry.npm.taobao.org/object-keys/download/object-keys-1.1.1.tgz",
-      "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=",
-      "dev": true
+      "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4="
     },
     "object-visit": {
       "version": "1.0.1",
@@ -23846,7 +23890,6 @@
       "version": "4.1.1",
       "resolved": "https://registry.npm.taobao.org/object.assign/download/object.assign-4.1.1.tgz?cache=0&sync_timestamp=1599844895115&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.assign%2Fdownload%2Fobject.assign-4.1.1.tgz",
       "integrity": "sha1-MDhnpmbN1Bk27N7fsfjz4ypHjN0=",
-      "dev": true,
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.18.0-next.0",
@@ -24124,6 +24167,11 @@
         "no-case": "^2.2.0"
       }
     },
+    "parchment": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmmirror.com/parchment/-/parchment-1.1.4.tgz",
+      "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="
+    },
     "parent-module": {
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/parent-module/download/parent-module-1.0.1.tgz",
@@ -25121,6 +25169,41 @@
       "integrity": "sha1-M0WUG0FTy50ILY7uTNogFqmu9/Y=",
       "dev": true
     },
+    "quill": {
+      "version": "1.3.7",
+      "resolved": "https://registry.npmmirror.com/quill/-/quill-1.3.7.tgz",
+      "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
+      "requires": {
+        "clone": "^2.1.1",
+        "deep-equal": "^1.0.1",
+        "eventemitter3": "^2.0.3",
+        "extend": "^3.0.2",
+        "parchment": "^1.1.4",
+        "quill-delta": "^3.6.2"
+      },
+      "dependencies": {
+        "clone": {
+          "version": "2.1.2",
+          "resolved": "https://registry.npmmirror.com/clone/-/clone-2.1.2.tgz",
+          "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w=="
+        },
+        "eventemitter3": {
+          "version": "2.0.3",
+          "resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-2.0.3.tgz",
+          "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="
+        }
+      }
+    },
+    "quill-delta": {
+      "version": "3.6.3",
+      "resolved": "https://registry.npmmirror.com/quill-delta/-/quill-delta-3.6.3.tgz",
+      "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
+      "requires": {
+        "deep-equal": "^1.0.1",
+        "extend": "^3.0.2",
+        "fast-diff": "1.1.2"
+      }
+    },
     "randombytes": {
       "version": "2.1.0",
       "resolved": "https://registry.npm.taobao.org/randombytes/download/randombytes-2.1.0.tgz",
@@ -25247,7 +25330,6 @@
       "version": "1.3.0",
       "resolved": "https://registry.npm.taobao.org/regexp.prototype.flags/download/regexp.prototype.flags-1.3.0.tgz",
       "integrity": "sha1-erqJs8E6ZFCdq888qNn7ub31y3U=",
-      "dev": true,
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.0-next.1"
@@ -25257,7 +25339,6 @@
           "version": "1.17.6",
           "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.6.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.6.tgz",
           "integrity": "sha1-kUIHFweFeyysx7iey2cDFsPi1So=",
-          "dev": true,
           "requires": {
             "es-to-primitive": "^1.2.1",
             "function-bind": "^1.1.1",
@@ -26389,7 +26470,6 @@
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/string.prototype.trimend/download/string.prototype.trimend-1.0.1.tgz?cache=0&sync_timestamp=1586465233837&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimend%2Fdownload%2Fstring.prototype.trimend-1.0.1.tgz",
       "integrity": "sha1-hYEqa4R6wAInD1gIFGBkyZX7aRM=",
-      "dev": true,
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.5"
@@ -26399,7 +26479,6 @@
           "version": "1.17.6",
           "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.6.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.6.tgz",
           "integrity": "sha1-kUIHFweFeyysx7iey2cDFsPi1So=",
-          "dev": true,
           "requires": {
             "es-to-primitive": "^1.2.1",
             "function-bind": "^1.1.1",
@@ -26420,7 +26499,6 @@
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/string.prototype.trimstart/download/string.prototype.trimstart-1.0.1.tgz?cache=0&sync_timestamp=1586465234129&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimstart%2Fdownload%2Fstring.prototype.trimstart-1.0.1.tgz",
       "integrity": "sha1-FK9tnzSwU/fPyJty+PLuFLkDmlQ=",
-      "dev": true,
       "requires": {
         "define-properties": "^1.1.3",
         "es-abstract": "^1.17.5"
@@ -26430,7 +26508,6 @@
           "version": "1.17.6",
           "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.17.6.tgz?cache=0&sync_timestamp=1597446132183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.17.6.tgz",
           "integrity": "sha1-kUIHFweFeyysx7iey2cDFsPi1So=",
-          "dev": true,
           "requires": {
             "es-to-primitive": "^1.2.1",
             "function-bind": "^1.1.1",
@@ -26732,6 +26809,11 @@
       "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
       "dev": true
     },
+    "tinymce": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmmirror.com/tinymce/-/tinymce-5.1.0.tgz",
+      "integrity": "sha512-zprr8gLHNCxxT4ebgwwIg1erhxQs1GUb3YHgNlRAuGRButDsrn35e1HW9YtMli/AnuY+ECcqyqhEI/wUNMYEFw=="
+    },
     "tmp": {
       "version": "0.0.33",
       "resolved": "https://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz",
@@ -27337,6 +27419,15 @@
         }
       }
     },
+    "vue-quill-editor": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmmirror.com/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz",
+      "integrity": "sha512-g20oSZNWg8Hbu41Kinjd55e235qVWPLfg4NvsLW6d+DhgBTFbEuMpcWlUdrD6qT3+Noim6DRu18VLM9lVShXOQ==",
+      "requires": {
+        "object-assign": "^4.1.1",
+        "quill": "^1.3.4"
+      }
+    },
     "vue-router": {
       "version": "3.4.5",
       "resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.4.5.tgz?cache=0&sync_timestamp=1601130992163&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.4.5.tgz",

+ 1 - 0
package.json

@@ -30,6 +30,7 @@
     "vue-cookies": "^1.7.4",
     "vue-filepond": "^6.0.3",
     "vue-infinite-scroll": "^2.0.2",
+    "vue-quill-editor": "^3.0.6",
     "vue-router": "^3.4.5",
     "vue-simple-uploader": "^0.7.6",
     "vuetify": "^2.3.12",

+ 87 - 0
src/components/upload/publish-article.vue

@@ -0,0 +1,87 @@
+<template>
+  <div>
+    <v-row justify="center">
+      <v-text-field
+        v-model="articlePost.title"
+        placeholder="标题"
+        label="标题(50字以内)"
+        clearable
+      />
+    </v-row>
+    <v-row justify="center">
+      <v-btn @click="publish">立即投稿</v-btn>
+    </v-row>
+    <v-row justify="center" align="center">
+      <RichText @content="procContent" />
+    </v-row>
+    <v-snackbar
+      v-model="showMessage"
+      :top="true"
+      :timeout="3000"
+    >
+      {{ message }}
+      <template v-slot:action="{ attrs }">
+        <v-btn
+          color="pink"
+          text
+          v-bind="attrs"
+          @click="showMessage = false"
+        >
+          关闭
+        </v-btn>
+      </template>
+    </v-snackbar>
+  </div>
+</template>
+
+<script>
+import RichText from '@/components/upload/rich-text'
+
+export default {
+  components: {
+    RichText
+  },
+  data() {
+    return {
+      articlePost: {
+        title: null,
+        content: null
+      },
+      showMessage: false,
+      message: ''
+    }
+  },
+  created() {
+  },
+  methods: {
+    setTitle(title) {
+      if (title.length > 50) {
+        this.articlePost.title = title.substring(0, 50)
+      } else {
+        this.articlePost.title = title
+      }
+    },
+    procContent(value) {
+      this.articlePost.content = value
+    },
+    publish() {
+      if (this.articlePost.title === null || this.articlePost.title === '') {
+        this.message = '稿件标题不能为空'
+        this.showMessage = true
+        return
+      }
+
+      if (this.articlePost.content === null) {
+        this.message = '你还没有编写内容'
+        this.showMessage = true
+        return
+      }
+
+      console.log(this.articlePost)
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 0 - 5
src/views/studio/upload1.vue → src/components/upload/publish-audio.vue

@@ -5,11 +5,6 @@
         class="mx-auto"
         outlined
       >
-        <v-row justify="center">
-          <v-col cols="10">
-            <h2>发布音频贴</h2>
-          </v-col>
-        </v-row>
         <v-row justify="center">
           <v-col>
             <uploader

+ 161 - 0
src/components/upload/publish-image.vue

@@ -0,0 +1,161 @@
+<template>
+  <v-row justify="center" align="center">
+    <v-col>
+      <v-card
+        class="mx-auto"
+        outlined
+      >
+        <v-row justify="center">
+          <v-col>
+            <file-pond
+              ref="pond"
+              name="file"
+              label-idle="选择图片或拖动图片到此处"
+              label-file-processing="图片正在上传,请稍后"
+              label-file-processing-aborted="图片上传被取消"
+              label-tap-to-retry="尝试重试"
+              label-file-processing-complete="图片上传成功!"
+              label-max-file-size="上传的图片大小不能超过 10MB"
+              label-max-file-size-exceeded="上传的图片大小不能超过 10MB"
+              allow-file-size-validation="true"
+              max-file-size="10MB"
+              accepted-file-types="image/png, image/jpeg, image/jpg, image/gif"
+              :allow-multiple="true"
+              :max-files="9"
+              :server="server"
+              :instant-upload="true"
+              @init="handleFilePondInit"
+              @processfile="success"
+              @removefile="removeFile"
+            />
+          </v-col>
+        </v-row>
+        <v-divider />
+        <v-row justify="center">
+          <v-col cols="10">
+            <h2>稿件信息</h2>
+          </v-col>
+        </v-row>
+        <v-row justify="center">
+          <v-col cols="10">
+            <v-text-field
+              v-model="imagePost.title"
+              placeholder="标题"
+              label="标题(50字以内)"
+              clearable
+            />
+          </v-col>
+        </v-row>
+        <v-row justify="center">
+          <v-col cols="10">
+            <v-btn large color="primary" @click="publish">立即投稿</v-btn>
+          </v-col>
+        </v-row>
+      </v-card>
+    </v-col>
+
+    <v-snackbar
+      v-model="showMessage"
+      :top="true"
+      :timeout="3000"
+    >
+      {{ message }}
+      <template v-slot:action="{ attrs }">
+        <v-btn
+          color="pink"
+          text
+          v-bind="attrs"
+          @click="showMessage = false"
+        >
+          关闭
+        </v-btn>
+      </template>
+    </v-snackbar>
+  </v-row>
+</template>
+
+<script>
+import VueFilePond from 'vue-filepond'
+import FilePondPluginImagePreview from 'filepond-plugin-image-preview'
+import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type'
+import FilePondPluginFileValidateSize from 'filepond-plugin-file-validate-size'
+import 'filepond/dist/filepond.min.css'
+import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css'
+
+VueFilePond(
+  FilePondPluginFileValidateType,
+  FilePondPluginImagePreview,
+  FilePondPluginFileValidateSize
+)
+
+export default {
+  data() {
+    return {
+      showMessage: false,
+      message: '',
+      server: {
+        url: '//api.reghao.cn/api/file/upload/image',
+        revert: null,
+        process: {
+          headers: {
+            'Authorization': this.$store.getters.token
+          },
+          ondata(formData) {
+            return formData
+          },
+          onload(response) {
+            const resp = JSON.parse(response)
+            if (resp.code === 0) {
+              // imgFileIds.push(resp.data.imageFileId)
+            } else {
+              if (resp.msg != null) {
+                this.message = '上传文件出现异常,请重新上传!' + resp.msg
+              } else {
+                this.message = '上传文件出现异常,请重新上传!'
+              }
+              this.showMessage = true
+            }
+          }
+        }
+      },
+      imagePost: {
+      }
+    }
+  },
+  created() {
+  },
+  methods: {
+    handleFilePondInit() {
+      // FilePond instance methods are available on `this.$refs.pond`
+    },
+    success(error, metadata) {
+      if (error === null) {
+        return
+      }
+    },
+    removeFile(error, metadata) {
+      if (error === null) {
+        const file = metadata.file
+        const uploadId = this.imgMap[file.name]
+        fetch('//file.reghao.cn/api/file/rm/' + uploadId, {
+          headers: {
+            'Authorization': this.$store.getters.token
+          },
+          method: 'DELETE'
+        }).then(response => response.json())
+          .then(json => {
+            console.log('删除 this.statusPost.imageFileIds 中相应的图片')
+          })
+          .catch(e => {
+            return null
+          })
+      }
+    },
+    publish() {
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 421 - 0
src/components/upload/publish-video.vue

@@ -0,0 +1,421 @@
+<template>
+  <v-row justify="center" align="center">
+    <v-col>
+      <v-card
+        class="mx-auto"
+        outlined
+      >
+        <v-row justify="center">
+          <v-col>
+            <uploader
+              class="uploader-example"
+              :options="options"
+              :auto-start="true"
+              @file-added="onFileAdded"
+              @file-success="onFileSuccess"
+              @file-progress="onFileProgress"
+              @file-error="onFileError"
+            >
+              <uploader-unsupport />
+              <uploader-drop>
+                <p>拖动视频文件到此处或</p>
+                <uploader-btn :attrs="attrs">选择视频文件</uploader-btn>
+              </uploader-drop>
+              <uploader-list />
+            </uploader>
+          </v-col>
+        </v-row>
+        <v-row justify="center">
+          <v-col cols="5">
+            <v-card outlined>
+              <v-img :src="videoPost.imageUrl" aspect-ratio="1.77" contain max-height="150" alt="封面图,推荐16:9" />
+            </v-card>
+          </v-col>
+          <v-col cols="5">
+            <v-file-input
+              :rules="rules"
+              accept="image/png, image/jpeg, image/bmp"
+              prepend-icon="mdi-image"
+              placeholder="上传视频封面"
+              label="封面"
+              @change="setFile"
+            />
+            <v-btn color="primary" @click="uploadVideoCover">
+              上传
+            </v-btn>
+          </v-col>
+        </v-row>
+        <v-divider />
+        <v-row justify="center">
+          <v-col cols="10">
+            <h2>稿件信息</h2>
+          </v-col>
+        </v-row>
+        <v-row justify="center">
+          <v-col cols="5">
+            <v-select
+              :items="category"
+              label="分区"
+              @change="getCategory"
+            />
+          </v-col>
+          <v-col cols="5">
+            <v-select
+              :items="childCategory"
+              label="子分区"
+              @change="getChildCategory"
+            />
+          </v-col>
+        </v-row>
+        <v-row justify="center">
+          <v-col cols="10">
+            <v-text-field
+              v-model="videoPost.title"
+              placeholder="标题"
+              label="标题(50字以内)"
+              clearable
+            />
+          </v-col>
+        </v-row>
+        <v-row justify="center">
+          <v-col cols="10">
+            <v-textarea
+              v-model="videoPost.description"
+              label="简介(200字以内)"
+              clearable
+              placeholder="填写更全面的视频信息,让更多的人找到你!"
+            />
+          </v-col>
+        </v-row>
+        <v-row justify="center">
+          <v-col cols="10">
+            <v-combobox
+              v-model="videoPost.tags"
+              label="添加标签让更多人找到你(最多6个)"
+              multiple
+              chips
+              clearable
+            />
+          </v-col>
+        </v-row>
+        <!--        <v-row justify="center">
+          <v-col cols="10">
+            <v-select
+              :items="scope"
+              label="可见范围"
+              @change="setVideoScope"
+            />
+          </v-col>
+        </v-row>-->
+        <v-row justify="center">
+          <v-col cols="10">
+            <v-btn large color="primary" @click="publish">立即投稿</v-btn>
+          </v-col>
+        </v-row>
+      </v-card>
+    </v-col>
+
+    <v-snackbar
+      v-model="showMessage"
+      :top="true"
+      :timeout="3000"
+    >
+      {{ message }}
+      <template v-slot:action="{ attrs }">
+        <v-btn
+          color="pink"
+          text
+          v-bind="attrs"
+          @click="showMessage = false"
+        >
+          关闭
+        </v-btn>
+      </template>
+    </v-snackbar>
+  </v-row>
+</template>
+
+<script>
+import { videoCategory, submitVideoPost } from '@/api/media/video'
+/* import { hashFile } from '@/utils/hash' */
+
+export default {
+  data() {
+    return {
+      options: {
+        target: '//api.reghao.cn' + '/api/file/upload/video',
+        chunkSize: 1024 * 1024 * 1024 * 5, // 分片大小 5GiB
+        forceChunkSize: true,
+        fileParameterName: 'file',
+        maxChunkRetries: 3,
+        testChunks: true,
+        checkChunkUploadedByResponse: function(chunk, message) {
+          const objMessage = JSON.parse(message)
+          console.log('分片文件检验')
+          console.log(objMessage)
+          if (objMessage.skipUpload) {
+            return true
+          }
+
+          return (objMessage.uploaded || []).indexOf(chunk.offset + 1) >= 0
+        },
+        headers: {
+          Authorization: 'Bearer ' + this.$store.getters.token
+        }
+      },
+      attrs: {
+        accept: 'video/*'
+      },
+      rules: [
+        value => !value || value.size < 2000000 || 'Avatar size should be less than 2 MB!'
+      ],
+      // 提交给后端的数据
+      videoPost: {
+        videoFileId: null,
+        coverFileId: null,
+        title: null,
+        description: null,
+        categoryId: null,
+        tags: [],
+        scope: 1
+      },
+      categoryMap: {
+        Set: function(key, value) { this[key] = value },
+        Get: function(key) { return this[key] },
+        Contains: function(key) { return this.Get(key) !== null },
+        Remove: function(key) { delete this[key] }
+      },
+      category: [],
+      childCategory: [],
+      scope: [
+        '所有人可见',
+        '验证码可见',
+        'VIP 可见',
+        '仅自己可见'
+      ],
+      nowCategory: {},
+      coverFile: null,
+      showMessage: false,
+      message: ''
+    }
+  },
+  created() {
+    this.getVideoCategory()
+  },
+  methods: {
+    onFileAdded(file) {
+      this.setTitle(file.file.name)
+
+      /* file.pause()
+      hashFile(file.file).then(res => {
+        const formData = new FormData()
+        formData.append('filename', file.file.name)
+        formData.append('size', file.file.size)
+        formData.append('sha256sum', res.sha256sum)
+        fetch(`//file.reghao.cn` + `/api/file/upload/video/prepare`, {
+          headers: {
+            Authorization: 'Bearer ' + this.$store.getters.token
+          },
+          method: 'POST',
+          credentials: 'include',
+          body: formData
+        }).then(response => response.json())
+          .then(json => {
+            const uploadId = json.data.uploadId
+            const exist = json.data.exist
+            if (exist) {
+              this.message = '视频已存在'
+              this.showMessage = true
+              file.cancel()
+            } else {
+              file.uniqueIdentifier = uploadId
+              file.resume()
+            }
+          })
+          .catch(e => {
+            return null
+          })
+      })*/
+    },
+    onFileProgress(rootFile, file, chunk) {
+    },
+    onFileSuccess(rootFile, file, response, chunk) {
+      const res = JSON.parse(response)
+      if (res.code === 0) {
+        const resData = res.data
+        if (resData.merged) {
+          this.message = '视频已上传'
+          this.showMessage = true
+          this.videoPost.videoFileId = resData.videoFileId
+        }
+      }
+    },
+    onFileError(rootFile, file, response, chunk) {
+      console.log('文件上传错误')
+    },
+    publish() {
+      if (!this.videoPost.videoFileId) {
+        this.message = '你还没有上传视频'
+        this.showMessage = true
+        return
+      }
+
+      if (!this.videoPost.coverFileId) {
+        this.message = '你还没有上传视频封面'
+        this.showMessage = true
+        return
+      }
+
+      if (this.videoPost.title === '' || this.videoPost.categoryId === -1) {
+        this.message = '分区和稿件标题不能为空'
+        this.showMessage = true
+        return
+      }
+
+      /* if (this.videoPost.scope === null) {
+        this.message = '稿件可见范围不能为空'
+        this.showMessage = true
+        return
+      }*/
+
+      if (this.videoPost.tags.length === 0 || this.videoPost.tags.length > 10) {
+        this.message = '标签最少 1 个, 最多 10 个'
+        this.showMessage = true
+        return
+      }
+
+      submitVideoPost(this.videoPost)
+        .then(res => {
+          if (res.code === 0) {
+            this.message = '投稿成功,等待审核通过后其他人就可以看到你的视频了'
+            this.showMessage = true
+            this.$router.push('/studio')
+          } else {
+            this.message = res.msg
+            this.showMessage = true
+          }
+        })
+        .catch(error => {
+          console.error(error.message)
+        })
+    },
+    setFile(value) {
+      this.coverFile = value
+    },
+    setTitle(title) {
+      if (title.length > 50) {
+        this.videoPost.title = title.substring(0, 50)
+      } else {
+        this.videoPost.title = title
+      }
+    },
+    uploadVideoCover() {
+      if (this.coverFile === null) {
+        this.message = '请先选择视频封面,然后上传!'
+        this.showMessage = true
+        return
+      }
+
+      if (this.videoPost.videoFileId === null) {
+        this.message = '等待视频上传完成后再上传封面!'
+        this.showMessage = true
+        return
+      }
+
+      const formData = new FormData()
+      formData.append('videoFileId', this.videoPost.videoFileId)
+      formData.append('file', this.coverFile)
+      fetch(`//api.reghao.cn/api/file/upload/video/cover`, {
+        headers: {
+          'Authorization': 'Bearer ' + this.$store.getters.token
+        },
+        method: 'POST',
+        credentials: 'include',
+        body: formData
+      }).then(response => response.json())
+        .then(json => {
+          if (json.code === 0) {
+            this.message = '封面已上传'
+            this.showMessage = true
+            this.videoPost.coverFileId = json.data.imageFileId
+            this.videoPost.imageUrl = json.data.imageUrl
+          } else {
+            this.message = '上传失败,请重试!' + json.message
+            this.showMessage = true
+          }
+        })
+        .catch(e => {
+          return null
+        })
+    },
+    getVideoCategory() {
+      videoCategory()
+        .then(res => {
+          if (res.code === 0) {
+            for (let i = 0; i < res.data.length; i++) {
+              const name = res.data[i].name
+              this.category.push(name)
+              this.categoryMap.Set(name, res.data[i])
+            }
+          } else {
+            console.error(res.msg)
+          }
+        })
+        .catch(error => {
+          console.error(error.message)
+        })
+    },
+    getCategory(name) {
+      // 重置子分区,清除前一次选择分区时留下的缓存
+      this.childCategory = []
+      this.currentCategory = this.categoryMap.Get(name)
+      this.videoPost.categoryId = this.currentCategory.id
+
+      const c = this.currentCategory.children
+      if (c) {
+        for (let i = 0; i < c.length; i++) {
+          this.childCategory.push(c[i].name)
+        }
+      }
+    },
+    getChildCategory(name) {
+      const c = this.currentCategory.children
+      for (let i = 0; i < c.length; i++) {
+        if (c[i].name === name) {
+          this.videoPost.categoryId = c[i].id
+        }
+      }
+    },
+    setVideoScope(scope) {
+      if (scope === '所有人可见') {
+        this.videoPost.scope = 1
+      } else if (scope === '验证码可见') {
+        this.videoPost.scope = 2
+      } else if (scope === 'VIP 可见') {
+        this.videoPost.scope = 3
+      } else if (scope === '仅自己可见') {
+        this.videoPost.scope = 4
+      }
+    }
+  }
+}
+</script>
+
+<style>
+  .uploader-example {
+    width: 500px;
+    padding: 15px;
+    margin: 40px auto 0;
+    font-size: 12px;
+    box-shadow: 0 0 10px rgba(0, 0, 0, .4);
+  }
+  .uploader-example .uploader-btn {
+    margin-right: 4px;
+  }
+  .uploader-example .uploader-list {
+    max-height: 440px;
+    overflow: auto;
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+</style>

+ 131 - 0
src/components/upload/rich-text.vue

@@ -0,0 +1,131 @@
+<template>
+  <quill-editor
+    ref="myTextEditor"
+    v-model="content"
+    class="editor"
+    :options="editorOption"
+    @change="onEditorChange($event)"
+  />
+</template>
+
+<script>
+const toolbar = [
+  ['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
+  ['blockquote', 'code-block'], // 引用  代码块
+  [{ header: 1 }, { header: 2 }], // 1、2 级标题
+  [{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
+  //   [{ script: "sub" }, { script: "super" }], // 上标/下标
+  //   [{ indent: "-1" }, { indent: "+1" }], // 缩进
+  // [{'direction': 'rtl'}],                         // 文本方向
+  [{ size: ['small', false, 'large', 'huge'] }], // 字体大小
+  [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
+  [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
+  [{ font: [] }], // 字体种类
+  [{ align: [] }], // 对齐方式
+  ['clean'], // 清除文本格式
+  ['link', 'image', 'video'] // 链接、图片、视频
+] // 工具菜单栏配置
+export default {
+  data() {
+    return {
+      content: null, // 内容
+      editorOption: {
+        modules: {
+          toolbar
+        },
+        placeholder: '', // 提示
+        readyOnly: false, // 是否只读
+        theme: 'snow', // 主题 snow/bubble
+        syntax: true // 语法检测
+      }
+    }
+  },
+  methods: {
+    // 值发生变化
+    onEditorChange(editor) {
+      this.content = editor.html
+      this.$emit('content', editor.html)
+    }
+  }
+}
+</script>
+
+<style>
+.editor {
+  line-height: normal !important;
+  height: 480px;
+  margin-bottom: 30px;
+}
+.ql-snow .ql-tooltip[data-mode="link"]::before {
+  content: "请输入链接地址:";
+}
+.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
+  border-right: 0px;
+  content: "保存";
+  padding-right: 0px;
+}
+
+.ql-snow .ql-tooltip[data-mode="video"]::before {
+  content: "请输入视频地址:";
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-label::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item::before {
+  content: "14px";
+}
+.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
+  content: "10px";
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
+  content: "18px";
+}
+.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
+  content: "32px";
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item::before {
+  content: "文本";
+}
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
+  content: "标题1";
+}
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
+  content: "标题2";
+}
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
+  content: "标题3";
+}
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
+  content: "标题4";
+}
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
+  content: "标题5";
+}
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
+  content: "标题6";
+}
+
+.ql-snow .ql-picker.ql-font .ql-picker-label::before,
+.ql-snow .ql-picker.ql-font .ql-picker-item::before {
+  content: "标准字体";
+}
+.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
+.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
+  content: "衬线字体";
+}
+.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
+.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
+  content: "等宽字体";
+}
+</style>

+ 5 - 0
src/main.js

@@ -9,12 +9,17 @@ import 'viewerjs/dist/viewer.css'
 import VueViewer from 'v-viewer'
 import uploader from 'vue-simple-uploader'
 import AudioPlayer from '@liripeng/vue-audio-player'
+import VueQuillEditor from 'vue-quill-editor'
+import 'quill/dist/quill.core.css'
+import 'quill/dist/quill.snow.css'
+import 'quill/dist/quill.bubble.css'
 
 Vue.use(VueCookies)
 Vue.use(infiniteScroll)
 Vue.use(VueViewer)
 Vue.use(uploader)
 Vue.use(AudioPlayer)
+Vue.use(VueQuillEditor)
 
 Vue.config.productionTip = false
 

+ 3 - 2
src/views/mblog/mblog.vue

@@ -180,12 +180,13 @@ import { pubStatus, statusRecommend } from '@/api/mblog/status'
 import { videoTimeline } from '@/api/media/video'
 import StatusCard from '@/components/card/status-card'
 import ItemCard from '@/components/card/item-card'
+
 import VueFilePond from 'vue-filepond'
-import 'filepond/dist/filepond.min.css'
 import FilePondPluginImagePreview from 'filepond-plugin-image-preview'
-import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css'
 import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type'
 import FilePondPluginFileValidateSize from 'filepond-plugin-file-validate-size'
+import 'filepond/dist/filepond.min.css'
+import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css'
 
 const FilePond = VueFilePond(
   FilePondPluginFileValidateType,

+ 0 - 12
src/views/studio/index.vue

@@ -32,19 +32,7 @@
                 </v-list-item-content>
               </v-list-item>
             </router-link>
-
             <v-divider class="my-2" />
-
-            <v-list-item
-              link
-              color="grey lighten-4"
-            >
-              <v-list-item-content>
-                <v-list-item-title>
-                  Refresh
-                </v-list-item-title>
-              </v-list-item-content>
-            </v-list-item>
           </v-list>
         </v-sheet>
       </v-col>

+ 27 - 408
src/views/studio/upload.vue

@@ -1,426 +1,45 @@
 <template>
-  <v-row justify="center" align="center">
-    <v-col>
-      <v-card
-        class="mx-auto"
-        outlined
-      >
-        <v-row justify="center">
-          <v-col cols="10">
-            <h2>发布视频贴</h2>
-          </v-col>
-        </v-row>
-        <v-row justify="center">
-          <v-col>
-            <uploader
-              class="uploader-example"
-              :options="options"
-              :auto-start="true"
-              @file-added="onFileAdded"
-              @file-success="onFileSuccess"
-              @file-progress="onFileProgress"
-              @file-error="onFileError"
-            >
-              <uploader-unsupport />
-              <uploader-drop>
-                <p>拖动视频文件到此处或</p>
-                <uploader-btn :attrs="attrs">选择视频文件</uploader-btn>
-              </uploader-drop>
-              <uploader-list />
-            </uploader>
-          </v-col>
-        </v-row>
-        <v-row justify="center">
-          <v-col cols="5">
-            <v-card outlined>
-              <v-img :src="videoPost.imageUrl" aspect-ratio="1.77" contain max-height="150" alt="封面图,推荐16:9" />
-            </v-card>
-          </v-col>
-          <v-col cols="5">
-            <v-file-input
-              :rules="rules"
-              accept="image/png, image/jpeg, image/bmp"
-              prepend-icon="mdi-image"
-              placeholder="上传视频封面"
-              label="封面"
-              @change="setFile"
-            />
-            <v-btn color="primary" @click="uploadVideoCover">
-              上传
-            </v-btn>
-          </v-col>
-        </v-row>
-        <v-divider />
-        <v-row justify="center">
-          <v-col cols="10">
-            <h2>稿件信息</h2>
-          </v-col>
-        </v-row>
-        <v-row justify="center">
-          <v-col cols="5">
-            <v-select
-              :items="category"
-              label="分区"
-              @change="getCategory"
-            />
-          </v-col>
-          <v-col cols="5">
-            <v-select
-              :items="childCategory"
-              label="子分区"
-              @change="getChildCategory"
-            />
-          </v-col>
-        </v-row>
-        <v-row justify="center">
-          <v-col cols="10">
-            <v-text-field
-              v-model="videoPost.title"
-              placeholder="标题"
-              label="标题(50字以内)"
-              clearable
-            />
-          </v-col>
-        </v-row>
-        <v-row justify="center">
-          <v-col cols="10">
-            <v-textarea
-              v-model="videoPost.description"
-              label="简介(200字以内)"
-              clearable
-              placeholder="填写更全面的视频信息,让更多的人找到你!"
-            />
-          </v-col>
-        </v-row>
-        <v-row justify="center">
-          <v-col cols="10">
-            <v-combobox
-              v-model="videoPost.tags"
-              label="添加标签让更多人找到你(最多6个)"
-              multiple
-              chips
-              clearable
-            />
-          </v-col>
-        </v-row>
-        <v-row justify="center">
-          <v-col cols="10">
-            <v-select
-              :items="scope"
-              label="可见范围"
-              @change="setVideoScope"
-            />
-          </v-col>
-        </v-row>
-        <v-row justify="center">
-          <v-col cols="10">
-            <v-btn large color="primary" @click="publish">立即投稿</v-btn>
-          </v-col>
-        </v-row>
-      </v-card>
-    </v-col>
-
-    <v-snackbar
-      v-model="showMessage"
-      :top="true"
-      :timeout="3000"
-    >
-      {{ message }}
-      <template v-slot:action="{ attrs }">
-        <v-btn
-          color="pink"
-          text
-          v-bind="attrs"
-          @click="showMessage = false"
-        >
-          关闭
-        </v-btn>
-      </template>
-    </v-snackbar>
-  </v-row>
+  <v-container fill-height>
+    <v-tabs>
+      <v-tab @click="setShow(1)">视频贴</v-tab>
+      <v-tab @click="setShow(2)">音频贴</v-tab>
+      <v-tab @click="setShow(3)">图片贴</v-tab>
+      <v-tab @click="setShow(4)">文章贴</v-tab>
+    </v-tabs>
+    <PublishVideo v-if="show === 1" />
+    <PublishAudio v-if="show === 2" />
+    <PublishImage v-if="show === 3" />
+    <PublishArticle v-if="show === 4" />
+  </v-container>
 </template>
 
 <script>
-import { videoCategory, submitVideoPost } from '@/api/media/video'
-/* import { hashFile } from '@/utils/hash' */
+import PublishVideo from '@/components/upload/publish-video.vue'
+import PublishAudio from '@/components/upload/publish-audio.vue'
+import PublishImage from '@/components/upload/publish-image.vue'
+import PublishArticle from '@/components/upload/publish-article.vue'
 
 export default {
+  name: 'Upload',
+  components: {
+    PublishVideo,
+    PublishAudio,
+    PublishImage,
+    PublishArticle
+  },
   data() {
     return {
-      options: {
-        target: '//api.reghao.cn' + '/api/file/upload/video',
-        chunkSize: 1024 * 1024 * 1024 * 5, // 分片大小 5GiB
-        forceChunkSize: true,
-        fileParameterName: 'file',
-        maxChunkRetries: 3,
-        testChunks: true,
-        checkChunkUploadedByResponse: function(chunk, message) {
-          const objMessage = JSON.parse(message)
-          console.log('分片文件检验')
-          console.log(objMessage)
-          if (objMessage.skipUpload) {
-            return true
-          }
-
-          return (objMessage.uploaded || []).indexOf(chunk.offset + 1) >= 0
-        },
-        headers: {
-          Authorization: 'Bearer ' + this.$store.getters.token
-        }
-      },
-      attrs: {
-        accept: 'video/*'
-      },
-      rules: [
-        value => !value || value.size < 2000000 || 'Avatar size should be less than 2 MB!'
-      ],
-      // 提交给后端的数据
-      videoPost: {
-        videoFileId: null,
-        coverFileId: null,
-        title: null,
-        description: null,
-        categoryId: null,
-        tags: [],
-        scope: null
-      },
-      categoryMap: {
-        Set: function(key, value) { this[key] = value },
-        Get: function(key) { return this[key] },
-        Contains: function(key) { return this.Get(key) !== null },
-        Remove: function(key) { delete this[key] }
-      },
-      category: [],
-      childCategory: [],
-      scope: [
-        '所有人可见',
-        '验证码可见',
-        'VIP 可见',
-        '仅自己可见'
-      ],
-      nowCategory: {},
-      coverFile: null,
-      showMessage: false,
-      message: ''
+      show: 1
     }
   },
-  created() {
-    this.getVideoCategory()
-  },
   methods: {
-    onFileAdded(file) {
-      this.setTitle(file.file.name)
-
-      /* file.pause()
-      hashFile(file.file).then(res => {
-        const formData = new FormData()
-        formData.append('filename', file.file.name)
-        formData.append('size', file.file.size)
-        formData.append('sha256sum', res.sha256sum)
-        fetch(`//file.reghao.cn` + `/api/file/upload/video/prepare`, {
-          headers: {
-            Authorization: 'Bearer ' + this.$store.getters.token
-          },
-          method: 'POST',
-          credentials: 'include',
-          body: formData
-        }).then(response => response.json())
-          .then(json => {
-            const uploadId = json.data.uploadId
-            const exist = json.data.exist
-            if (exist) {
-              this.message = '视频已存在'
-              this.showMessage = true
-              file.cancel()
-            } else {
-              file.uniqueIdentifier = uploadId
-              file.resume()
-            }
-          })
-          .catch(e => {
-            return null
-          })
-      })*/
-    },
-    onFileProgress(rootFile, file, chunk) {
-    },
-    onFileSuccess(rootFile, file, response, chunk) {
-      const res = JSON.parse(response)
-      if (res.code === 0) {
-        const resData = res.data
-        if (resData.merged) {
-          this.message = '视频已上传'
-          this.showMessage = true
-          this.videoPost.videoFileId = resData.videoFileId
-        }
-      }
-    },
-    onFileError(rootFile, file, response, chunk) {
-      console.log('文件上传错误')
-    },
-    publish() {
-      if (!this.videoPost.videoFileId) {
-        this.message = '你还没有上传视频'
-        this.showMessage = true
-        return
-      }
-
-      if (!this.videoPost.coverFileId) {
-        this.message = '你还没有上传视频封面'
-        this.showMessage = true
-        return
-      }
-
-      if (this.videoPost.title === '' || this.videoPost.categoryId === -1) {
-        this.message = '分区和稿件标题不能为空'
-        this.showMessage = true
-        return
-      }
-
-      if (this.videoPost.scope === null) {
-        this.message = '稿件可见范围不能为空'
-        this.showMessage = true
-        return
-      }
-
-      if (this.videoPost.tags.length === 0 || this.videoPost.tags.length > 10) {
-        this.message = '标签最少 1 个, 最多 10 个'
-        this.showMessage = true
-        return
-      }
-
-      submitVideoPost(this.videoPost)
-        .then(res => {
-          if (res.code === 0) {
-            this.message = '投稿成功,等待审核通过后其他人就可以看到你的视频了'
-            this.showMessage = true
-            this.$router.push('/studio')
-          } else {
-            this.message = res.msg
-            this.showMessage = true
-          }
-        })
-        .catch(error => {
-          console.error(error.message)
-        })
-    },
-    setFile(value) {
-      this.coverFile = value
-    },
-    setTitle(title) {
-      if (title.length > 50) {
-        this.videoPost.title = title.substring(0, 50)
-      } else {
-        this.videoPost.title = title
-      }
-    },
-    uploadVideoCover() {
-      if (this.coverFile === null) {
-        this.message = '请先选择视频封面,然后上传!'
-        this.showMessage = true
-        return
-      }
-
-      if (this.videoPost.videoFileId === null) {
-        this.message = '等待视频上传完成后再上传封面!'
-        this.showMessage = true
-        return
-      }
-
-      const formData = new FormData()
-      formData.append('videoFileId', this.videoPost.videoFileId)
-      formData.append('file', this.coverFile)
-      fetch(`//api.reghao.cn/api/file/upload/video/cover`, {
-        headers: {
-          'Authorization': 'Bearer ' + this.$store.getters.token
-        },
-        method: 'POST',
-        credentials: 'include',
-        body: formData
-      }).then(response => response.json())
-        .then(json => {
-          if (json.code === 0) {
-            this.message = '封面已上传'
-            this.showMessage = true
-            this.videoPost.coverFileId = json.data.imageFileId
-            this.videoPost.imageUrl = json.data.imageUrl
-          } else {
-            this.message = '上传失败,请重试!' + json.message
-            this.showMessage = true
-          }
-        })
-        .catch(e => {
-          return null
-        })
-    },
-    getVideoCategory() {
-      videoCategory()
-        .then(res => {
-          if (res.code === 0) {
-            for (let i = 0; i < res.data.length; i++) {
-              const name = res.data[i].name
-              this.category.push(name)
-              this.categoryMap.Set(name, res.data[i])
-            }
-          } else {
-            console.error(res.msg)
-          }
-        })
-        .catch(error => {
-          console.error(error.message)
-        })
-    },
-    getCategory(name) {
-      // 重置子分区,清除前一次选择分区时留下的缓存
-      this.childCategory = []
-      this.currentCategory = this.categoryMap.Get(name)
-      this.videoPost.categoryId = this.currentCategory.id
-
-      const c = this.currentCategory.children
-      if (c) {
-        for (let i = 0; i < c.length; i++) {
-          this.childCategory.push(c[i].name)
-        }
-      }
-    },
-    getChildCategory(name) {
-      const c = this.currentCategory.children
-      for (let i = 0; i < c.length; i++) {
-        if (c[i].name === name) {
-          this.videoPost.categoryId = c[i].id
-        }
-      }
-    },
-    setVideoScope(scope) {
-      if (scope === '所有人可见') {
-        this.videoPost.scope = 1
-      } else if (scope === '验证码可见') {
-        this.videoPost.scope = 2
-      } else if (scope === 'VIP 可见') {
-        this.videoPost.scope = 3
-      } else if (scope === '仅自己可见') {
-        this.videoPost.scope = 4
-      }
+    setShow(value) {
+      this.show = value
     }
   }
 }
 </script>
 
 <style>
-  .uploader-example {
-    width: 500px;
-    padding: 15px;
-    margin: 40px auto 0;
-    font-size: 12px;
-    box-shadow: 0 0 10px rgba(0, 0, 0, .4);
-  }
-  .uploader-example .uploader-btn {
-    margin-right: 4px;
-  }
-  .uploader-example .uploader-list {
-    max-height: 440px;
-    overflow: auto;
-    overflow-x: hidden;
-    overflow-y: auto;
-  }
+
 </style>

+ 0 - 12
src/views/user/userindex.vue

@@ -18,19 +18,7 @@
                 </v-list-item-content>
               </v-list-item>
             </router-link>
-
             <v-divider class="my-2" />
-
-            <v-list-item
-              link
-              color="grey lighten-4"
-            >
-              <v-list-item-content>
-                <v-list-item-title>
-                  Refresh
-                </v-list-item-title>
-              </v-list-item-content>
-            </v-list-item>
           </v-list>
         </v-sheet>
       </v-col>

+ 0 - 12
src/views/vip/index.vue

@@ -18,19 +18,7 @@
                 </v-list-item-content>
               </v-list-item>
             </router-link>
-
             <v-divider class="my-2" />
-
-            <v-list-item
-              link
-              color="grey lighten-4"
-            >
-              <v-list-item-content>
-                <v-list-item-title>
-                  Refresh
-                </v-list-item-title>
-              </v-list-item-content>
-            </v-list-item>
           </v-list>
         </v-sheet>
       </v-col>