Skip to content

Commit f32a9ee

Browse files
committed
feat: img use cdn
1 parent c964096 commit f32a9ee

21 files changed

+22
-15
lines changed

next.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
const nextConfig = {
22
distDir: 'build',
3+
images: {
4+
domains: [
5+
'assets.dtstack.com',
6+
],
7+
},
38
}
49

510
module.exports = nextConfig

public/images/home/Taier.png

-5.35 KB
Binary file not shown.

public/images/home/component.png

-67.6 KB
Binary file not shown.

public/images/home/design.png

-69.5 KB
Binary file not shown.

public/images/home/doraemon.png

-34.2 KB
Binary file not shown.

public/images/home/eye.png

-67.2 KB
Binary file not shown.

public/images/home/molecule.png

-24 KB
Binary file not shown.

src/components/navHeader.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { useRouter } from "next/router";
55
import { Dropdown, Space, Menu } from 'antd';
66
import { CaretDownOutlined } from '@ant-design/icons';
77
import Image from "next/image";
8-
import Logo from "../static/images/logo.png";
98
import styles from '../styles/navHeader.module.scss';
9+
import APP_CONF from "@/data/config";
1010

1111
interface IProps {
1212
isShow: boolean;
@@ -42,7 +42,7 @@ function NavHeader(props: IProps) {
4242
return (
4343
<div className={styles.nav}>
4444
<div className={styles.leftMenu} onClick={() => router.push('/')}>
45-
<Image src={Logo} width={46} height={52}/>
45+
<Image src={`${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/logo.png`} width={46} height={52}/>
4646
<div className={styles.subtitle}>袋鼠云数栈UED</div>
4747
</div>
4848
<div className={styles.rightMenu}>

src/data/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ const APP_CONF = {
66
DT_UTILS: 'https://dtstack.github.io/dt-utils/#/',
77
DT_SQL_PARSER: 'https://dtstack.github.io/monaco-sql-languages/',
88
DORAEMON: 'https://dtstack.github.io/doraemon/docsify/#/',
9+
IMAGE_DOMAIN: 'http://assets.dtstack.com',
910
}
1011
export default APP_CONF;

src/data/doc.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ export const AboutDoc = {
77
export const DesignSystem = [
88
{
99
key: 'design',
10-
imgUrl: '/images/home/design.png',
10+
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/design.png`,
1111
title: '设计价值观',
1212
subTitle: '基于「严谨理想」、「简约克制」、「节奏韵律」和「数字化」的设计价值观,创造美好的用户体验。',
1313
jumpUrl: 'https://dtstack.github.io/ant-design-dtinsight-theme/docs/react/introduce-cn'
1414
},
1515
{
1616
key: 'eye',
17-
imgUrl: '/images/home/eye.png',
17+
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/eye.png`,
1818
title: '视觉语言',
1919
subTitle: '以「极简易用」为设计理念,创造美好的用户体验同时赋能商业产品。',
2020
jumpUrl: 'https://dtstack.github.io/ant-design-dtinsight-theme/docs/react/color-cn'
2121
},
2222
{
2323
key: 'component',
24-
imgUrl: '/images/home/component.png',
24+
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/component.png`,
2525
title: 'UI 组件库',
2626
subTitle: '旨在数栈产品生态体系内,建立友好、高效、一致的用户体验,最大程度适应不同需求。',
2727
jumpUrl: 'https://dtstack.github.io/ant-design-dtinsight-theme/components/breadcrumb-cn/'
@@ -31,7 +31,7 @@ export const DesignSystem = [
3131
export const LeftOrigin = [
3232
{
3333
key: 'molecule',
34-
imgUrl: '/images/home/molecule.png',
34+
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/molecule.png`,
3535
title: 'Molecule',
3636
subTitle: '一个轻量级的 Web IDE UI 框架。',
3737
jumpUrl: APP_CONF.MOLECULE,
@@ -40,14 +40,14 @@ export const LeftOrigin = [
4040
export const RightOrigin = [
4141
{
4242
key: 'Taier',
43-
imgUrl: '/images/home/Taier.png',
43+
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/Taier.png`,
4444
title: 'Taier',
4545
subTitle: '大数据平台-分布式任务调度系统。',
4646
jumpUrl: APP_CONF.TAIER,
4747
},
4848
{
4949
key: 'doraemon',
50-
imgUrl: '/images/home/doraemon.png',
50+
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/doraemon.png`,
5151
title: 'Doraemon',
5252
subTitle: '一个帮你整理日常开发、配置、代理服务、主机资源的管理工具。',
5353
jumpUrl: APP_CONF.DORAEMON

src/pages/about/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { useEffect, useState } from 'react';
22
import NavHeader from "@/components/navHeader";
33
import styles from '@/styles/about.module.scss';
44
import Image from "next/image";
5-
import title from '@/static/images/about_title.png';
65
import {AboutDoc} from '@/data/doc';
6+
import APP_CONF from "@/data/config";
77

88
function Index() {
99
const [bgHeight, setBgHeight] = useState('0px');
@@ -18,7 +18,7 @@ function Index() {
1818
return <div>
1919
<NavHeader isShow={false}/>
2020
<div className={styles.centerBox}>
21-
<Image src={title} width={180} height={39}/>
21+
<Image src={`${APP_CONF.IMAGE_DOMAIN}/UEDLanding/About/about_title.png`} width={180} height={39}/>
2222
<div className={styles.excerpt}>{AboutDoc.subtitle}</div>
2323
</div>
2424
<div className={styles.content} style={{ height: bgHeight }}>

src/pages/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import NavHeader from "@/components/navHeader";
22
import Image from "next/image";
3-
import title from "@/static/images/home_title.png";
43
import styles from '@/styles/home.module.scss';
54
import {AboutDoc, DesignSystem, LeftOrigin, RightOrigin} from '@/data/doc';
65
import {useEffect, useState} from "react";
6+
import APP_CONF from "@/data/config";
77
import {Button} from "antd";
88

99
function Home() {
@@ -24,7 +24,7 @@ function Home() {
2424
<div className={styles.header} style={{ height: bgHeight }}>
2525
<NavHeader isShow={true}/>
2626
<div className={styles.title}>
27-
<Image src={title} width={423} height={39}/>
27+
<Image src={`${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/home_title.png`} width={423} height={39}/>
2828
</div>
2929
</div>
3030
<div className={styles.body}>

src/static/images/about_bg.png

-2.25 MB
Binary file not shown.

src/static/images/about_title.png

-8.75 KB
Binary file not shown.

src/static/images/home_background.png

-2.04 MB
Binary file not shown.

src/static/images/home_title.png

-22 KB
Binary file not shown.

src/static/images/logo.png

-7.46 KB
Binary file not shown.

src/static/images/openOrigin_bg.png

-955 KB
Binary file not shown.

src/styles/about.module.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818

1919
.content {
20-
background-image: url('../static/images/about_bg.png');
20+
background-image: url('http://assets.dtstack.com/UEDLanding/About/about_bg.png');
2121
background-repeat: no-repeat;
2222
background-size: cover;
2323
background-position: center;

src/styles/home.module.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.header {
2-
background-image: url('../static/images/home_background.png');
2+
background-image: url('http://assets.dtstack.com/UEDLanding/Home/home_background.png');
33
background-size: cover;
44
background-position: center;
55
background-repeat: no-repeat;
@@ -54,7 +54,7 @@
5454
}
5555

5656
.origin {
57-
background-image: url("../static/images/openOrigin_bg.png");
57+
background-image: url("http://assets.dtstack.com/UEDLanding/Home/openOrigin_bg.png");
5858
background-size: cover;
5959
background-position: center;
6060
background-repeat: no-repeat;

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"incremental": true,
1919
"esModuleInterop": true,
2020
"module": "esnext",
21+
"moduleResolution": "Node",
2122
"resolveJsonModule": true,
2223
"isolatedModules": true,
2324
"jsx": "preserve"

0 commit comments

Comments
 (0)