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