Authored by 陈峰

全局增加userId参数

@@ -74,7 +74,7 @@ module.exports = { @@ -74,7 +74,7 @@ module.exports = {
74 { 74 {
75 test: /\.vue$/, 75 test: /\.vue$/,
76 loader: 'vue-loader', 76 loader: 'vue-loader',
77 - include: [util.resolve('pages'), util.resolve('components')], 77 + // include: [util.resolve('pages'), util.resolve('components')],
78 options: { 78 options: {
79 loaders: { 79 loaders: {
80 scss: ExtractTextPlugin.extract({ 80 scss: ExtractTextPlugin.extract({
1 import menus from './menus'; 1 import menus from './menus';
2 import breadcrumb from './breadcrumb'; 2 import breadcrumb from './breadcrumb';
3 import userInfo from './user-info'; 3 import userInfo from './user-info';
  4 +// import quillEditor from './quill-editor';
4 5
5 export default [menus, breadcrumb, userInfo]; 6 export default [menus, breadcrumb, userInfo];
  1 +// 懒加载vue-quill-editor
  2 +const component = function quillEditor(r) {
  3 + require.ensure([], () => r(require('vue-quill-editor').quillEditor), 'editor');
  4 +};
  5 +
  6 +export default component;
1 <template> 1 <template>
2 <div> 2 <div>
3 overview 3 overview
  4 + <quill-editor v-model="content"
  5 + ref="myQuillEditor">
  6 + </quill-editor>
4 </div> 7 </div>
5 </template> 8 </template>
6 9
7 <script> 10 <script>
8 - export default {  
9 - data() {  
10 - return { 11 +export default {
  12 + created() {
  13 + },
  14 + data() {
  15 + return {
  16 + content: '',
  17 + editorOption: {
11 } 18 }
  19 + };
  20 + },
  21 + computed: {
  22 + editor() {
  23 + return this.$refs.myQuillEditor.quill;
12 } 24 }
13 } 25 }
  26 +};
14 </script> 27 </script>
15 28
16 <style lang="scss" scoped> 29 <style lang="scss" scoped>
@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
31 "uuid": "^3.0.1", 31 "uuid": "^3.0.1",
32 "vue": "^2.2.2", 32 "vue": "^2.2.2",
33 "vue-cookie": "^1.1.4", 33 "vue-cookie": "^1.1.4",
  34 + "vue-quill-editor": "^2.1.2",
34 "vue-router": "^2.2.0", 35 "vue-router": "^2.2.0",
35 "vue-template-compiler": "^2.2.6", 36 "vue-template-compiler": "^2.2.6",
36 "webpack-dev-server": "^2.4.2", 37 "webpack-dev-server": "^2.4.2",
@@ -40,7 +40,8 @@ module.exports = (req, res, next) => { @@ -40,7 +40,8 @@ module.exports = (req, res, next) => {
40 40
41 if (currentShop) { 41 if (currentShop) {
42 let params = Object.assign(req.query, req.body, { 42 let params = Object.assign(req.query, req.body, {
43 - shopsId: currentShop.shopsId 43 + shopsId: currentShop.shopsId,
  44 + userId: req.session.LOGIN_UID
44 }); 45 });
45 46
46 return api[req.method.toLowerCase()](apiUrl, params).then(data => { 47 return api[req.method.toLowerCase()](apiUrl, params).then(data => {