Skip to content

Commit 384d1d1

Browse files
committed
feat : umi add publicPath
1 parent 111903f commit 384d1d1

File tree

10 files changed

+38
-24
lines changed

10 files changed

+38
-24
lines changed

.umirc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default {
2020
},
2121
],
2222
],
23+
publicPath: '/code-river-pc/',
2324
history: 'hash',
2425
cssLoaderOptions: {},
2526
alias: {

src/component/common/BasicHeader/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default class BasicHeader extends Component {
4040
<Search style={{ width: 30, height: 30, verticalAlign: 'middle' }} />
4141
<span
4242
onClick={() => {
43-
router.push('/user');
43+
router.push('/user/login');
4444
}}
4545
>
4646
登录

src/component/user/style.less

Whitespace-only changes.

src/layouts/LoginLayout/index.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
import React from 'react';
2-
import loginbg from 'assets/images/login/loginbg.png';
2+
import styles from './style.less';
33

44
export default function LoginLayout(props) {
55
return (
6-
<div
7-
style={{
8-
backgroundImage: `url(${loginbg})`,
9-
width: '100%',
10-
height: '100vh',
11-
backgroundSize: 'cover',
12-
}}
13-
className={'cr-loginlayout'}
14-
>
15-
{props.children}
16-
</div>
6+
<article className={styles['cr-loginlayout']}>
7+
<section className={styles['cr-login-container']}>{props.children}</section>
8+
</article>
179
);
1810
}

src/layouts/LoginLayout/style.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.cr-loginlayout {
2+
width: 100%;
3+
height: 100vh;
4+
background: url(assets/images/login/loginbg.png) no-repeat center 0;
5+
6+
.cr-login-container {
7+
height: 100vh;
8+
width: 560px;
9+
background: rgba(225, 225, 225, 0.9);
10+
}
11+
}

src/layouts/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { isNull } from 'util';
99

1010
export default function(props: ComProps) {
1111
const firstLevenPath = getSinglePath(props.location.pathname);
12-
console.log(firstLevenPath);
1312
let ChlLayout = null;
1413
switch (firstLevenPath) {
1514
case 'display':
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
.normal {
32
font-family: Georgia, sans-serif;
43
margin-top: 4em;

src/pages/user/index.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/pages/user/login/index.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React, { Component } from 'react';
2+
3+
import styles from '../style.less';
4+
export default class Index extends Component {
5+
componentDidMount() {
6+
console.log('componentDidMount() {');
7+
}
8+
9+
render() {
10+
return (
11+
<div className={styles.login}>
12+
<div>logo</div>
13+
<h1>登录</h1>
14+
<p>还没有张虎?创建新账户</p>
15+
</div>
16+
);
17+
}
18+
}

src/pages/user/style.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.login {
2+
background: red;
3+
}

0 commit comments

Comments
 (0)