Browse Source

尝试pdf预览

guanchunjie 3 years ago
parent
commit
30d15e0fca
5 changed files with 15 additions and 3 deletions
  1. 2 1
      .env.development
  2. 1 0
      .env.production
  3. 1 1
      package.json
  4. 2 0
      src/views/courseList.vue
  5. 9 1
      vue.config.js

+ 2 - 1
.env.development

@@ -11,4 +11,5 @@ VUE_APP_BASE_API = '/dev-api'
 # when you have a large number of pages.
 # when you have a large number of pages.
 # Detail:  https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
 # Detail:  https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
 
 
-VUE_CLI_BABEL_TRANSPILE_MODULES = true
+VUE_CLI_BABEL_TRANSPILE_MODULES = true
+VUE_APP_PDF = '/pdf'

+ 1 - 0
.env.production

@@ -3,4 +3,5 @@ ENV = 'production'
 
 
 # base api
 # base api
 VUE_APP_BASE_API = ''
 VUE_APP_BASE_API = ''
+VUE_APP_PDF = ''
 
 

+ 1 - 1
package.json

@@ -17,7 +17,7 @@
     "@tinymce/tinymce-vue": "^3.2.8",
     "@tinymce/tinymce-vue": "^3.2.8",
     "awe-dnd": "^0.3.4",
     "awe-dnd": "^0.3.4",
     "axios": "0.18.1",
     "axios": "0.18.1",
-    "book-ui": "file:../GCLS-Book-question-ui/book-ui-0.1.26.tgz",
+    "book-ui": "file:../GCLS-Book-question-ui/book-ui-0.1.30.tgz",
     "cnchar": "^3.0.1",
     "cnchar": "^3.0.1",
     "cnchar-all": "^3.0.1",
     "cnchar-all": "^3.0.1",
     "cnchar-order": "^3.0.1",
     "cnchar-order": "^3.0.1",

+ 2 - 0
src/views/courseList.vue

@@ -521,10 +521,12 @@ export default {
       this.getList();
       this.getList();
     },
     },
     handleClick(row) {
     handleClick(row) {
+      sessionStorage.setItem("Bookdetail", JSON.stringify(row));
       this.$router.push("/input?bookId=" + row.id);
       this.$router.push("/input?bookId=" + row.id);
     },
     },
     // 预览
     // 预览
     handleView(row) {
     handleView(row) {
+      sessionStorage.setItem("Bookdetail", JSON.stringify(row));
       this.$router.push("/courseview?bookId=" + row.id);
       this.$router.push("/courseview?bookId=" + row.id);
     },
     },
     // 优惠码
     // 优惠码

+ 9 - 1
vue.config.js

@@ -44,11 +44,19 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
       [process.env.VUE_APP_BASE_API]: {
         target: `http://gcls.utschool.cn/`,
         target: `http://gcls.utschool.cn/`,
-        //target: `http://gcls.helxsoft.cn/`,
+        // target: `http://gcls.helxsoft.cn/`,
         changeOrigin: true,
         changeOrigin: true,
         pathRewrite: {
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''
           ['^' + process.env.VUE_APP_BASE_API]: ''
         }
         }
+      },
+      [process.env.VUE_APP_PDF]: {
+        // target: 'https://file-kf.helxsoft.cn/',
+        target: 'https://file-cs.helxsoft.cn/',
+        changeOrigin: true,
+        pathRewrite: {
+          ['^' + process.env.VUE_APP_PDF]: ''
+        }
       }
       }
     },
     },
     after: require('./mock/mock-server.js')
     after: require('./mock/mock-server.js')