Commit e856428eeb2ae7fc5eb1dd41cc47710084b8743d

Authored by ly525
1 parent b7211865

update previewUrl & relaseUrl & build publicPath

front-end/h5/src/components/core/editor/modals/preview.vue
... ... @@ -23,7 +23,7 @@ export default {
23 23 // work: state => state.work
24 24 // }),
25 25 releaseUrl () {
26   - return `${API_ORIGIN}/works/preview/${this.work.id}`
  26 + return `/works/preview/${this.work.id}`
27 27 }
28 28 },
29 29 data () {
... ...
front-end/h5/src/views/work-manager/list.vue
... ... @@ -2,7 +2,6 @@
2 2 import { mapState, mapActions } from 'vuex'
3 3 import QRCode from 'qrcode'
4 4  
5   -import { API_ORIGIN } from '@/constants/api.js'
6 5 import PreviewDialog from '@/components/core/editor/modals/preview.vue'
7 6 import CardCover from '@/components/common/work/card-cover.js'
8 7  
... ... @@ -32,7 +31,7 @@ const ListItemCard = {
32 31 return displayTime
33 32 },
34 33 genQRCodeUrl (work) {
35   - const url = `${API_ORIGIN}/works/preview/${work.id}`
  34 + const url = `/works/preview/${work.id}`
36 35 QRCode.toDataURL(url, (err, url) => {
37 36 if (err) console.log(err)
38 37 this.qrcodeUrl = url
... ...
front-end/h5/src/views/work-manager/templates.vue
... ... @@ -2,7 +2,6 @@
2 2 import { mapState, mapActions } from 'vuex'
3 3 import QRCode from 'qrcode'
4 4  
5   -import { API_ORIGIN } from '@/constants/api.js'
6 5 import PreviewDialog from '@/components/core/editor/modals/preview.vue'
7 6 import CardCover from '@/components/common/work/card-cover.js'
8 7  
... ... @@ -36,7 +35,7 @@ const ListItemCard = {
36 35 return displayTime
37 36 },
38 37 genQRCodeUrl (work) {
39   - const url = `${API_ORIGIN}/works/preview/${work.id}`
  38 + const url = `/works/preview/${work.id}`
40 39 QRCode.toDataURL(url, (err, url) => {
41 40 if (err) console.log(err)
42 41 this.qrcodeUrl = url
... ...
front-end/h5/vue.config.js
1   -const isProd = process.env.NODE_ENV === 'production'
2 1 const target = 'http://localhost:1337'
3 2 module.exports = {
4 3 runtimeCompiler: true,
5   - // 因为需要部署到 github pages,所以需要将 publicPath 设为 "/< GitHub Repo Name>/"
6   - publicPath: isProd ? '/luban-h5/' : '/',
7 4 productionSourceMap: false,
8 5 devServer: {
9   - // proxy: API_ORIGIN
10 6 proxy: {
11 7 '/works': {
12 8 target,
... ...