Commit e856428eeb2ae7fc5eb1dd41cc47710084b8743d
1 parent
b7211865
update previewUrl & relaseUrl & build publicPath
Showing
4 changed files
with
3 additions
and
9 deletions
front-end/h5/src/components/core/editor/modals/preview.vue
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, | ... | ... |