Commit 79ec52aae7568dd7f8a77a9b24b1921d26a75fa4

Authored by ly525
1 parent 425e44d8

fix: add landing page host

front-end/landing-page/.umirc.js
  1 +var path = require('path')
  2 +
1 3 export default {
2 4 publicPath: "/luban-h5/",
3 5 history: 'hash',
... ... @@ -9,5 +11,8 @@ export default {
9 11 antd: true,
10 12 }
11 13 ],
12   - ]
  14 + ],
  15 + chainWebpack(config) {
  16 + config.resolve.alias.set('@', path.resolve(__dirname, 'src'));
  17 + },
13 18 }
14 19 \ No newline at end of file
... ...
front-end/landing-page/src/Index-En/Page2.jsx
... ... @@ -16,7 +16,7 @@ export default function Page2() {
16 16 <div className="image" style={{ backgroundImage: `url(${d.image})` }} />
17 17 <div className="code-wrapper">
18 18 <h4>Scan Qr code to preview</h4>
19   - <QRCode value={window.location.origin + d.url} size={160} />
  19 + <QRCode value={d.url} size={160} />
20 20 </div>
21 21 </div>
22 22 </Col>);
... ...
front-end/landing-page/src/Index-En/data.js
1 1 import React from 'react';
  2 +import { H5_HOST } from '@/constants/config';
2 3  
3 4 export const page1 = [
4 5 {
... ... @@ -21,17 +22,17 @@ export const page1 = [
21 22 export const page2 = [
22 23 {
23 24 title: 'Invitation',
24   - url: '/works/preview/1552',
  25 + url: `${H5_HOST}/works/preview/1552`,
25 26 image: 'https://i.loli.net/2019/12/04/haEim2C6QnzVPOY.png',
26 27 },
27 28 {
28 29 title: 'Good Morning',
29   - url: '/works/preview/1551',
  30 + url: `${H5_HOST}/works/preview/1551`,
30 31 image: 'https://i.loli.net/2019/12/04/qBCmSl4Du8jn2XZ.png',
31 32 },
32 33 {
33 34 title: 'Day of the Programmer',
34   - url: '/works/preview/833',
  35 + url: `${H5_HOST}/works/preview/833`,
35 36 image: 'https://i.loli.net/2019/12/04/s7S1no4YcuJe8Qb.png',
36 37 },
37 38 ];
... ...
front-end/landing-page/src/Index/Page2.jsx
... ... @@ -16,7 +16,7 @@ export default function Page2() {
16 16 <div className="image" style={{ backgroundImage: `url(${d.image})` }} />
17 17 <div className="code-wrapper">
18 18 <h4>扫码预览</h4>
19   - <QRCode value={window.location.origin + d.url} size={160} />
  19 + <QRCode value={d.url} size={160} />
20 20 </div>
21 21 </div>
22 22 </Col>);
... ...
front-end/landing-page/src/Index/data.js
1 1 import React from 'react';
  2 +import { H5_HOST } from '@/constants/config';
2 3  
3 4 export const page1 = [
4 5 {
... ... @@ -20,18 +21,18 @@ export const page1 = [
20 21  
21 22 export const page2 = [
22 23 {
23   - title: '邀请函',
24   - url: '/works/preview/1552',
  24 + title: 'Invitation',
  25 + url: `${H5_HOST}/works/preview/1552`,
25 26 image: 'https://i.loli.net/2019/12/04/haEim2C6QnzVPOY.png',
26 27 },
27 28 {
28   - title: '早安',
29   - url: '/works/preview/1551',
  29 + title: 'Good Morning',
  30 + url: `${H5_HOST}/works/preview/1551`,
30 31 image: 'https://i.loli.net/2019/12/04/qBCmSl4Du8jn2XZ.png',
31 32 },
32 33 {
33   - title: '程序员节',
34   - url: '/works/preview/833',
  34 + title: 'Day of the Programmer',
  35 + url: `${H5_HOST}/works/preview/833`,
35 36 image: 'https://i.loli.net/2019/12/04/s7S1no4YcuJe8Qb.png',
36 37 },
37 38 ];
... ...
front-end/landing-page/src/constants/config.js 0 → 100644
  1 +export const H5_HOST = 'https://h5.luban-h5.com'
0 2 \ No newline at end of file
... ...