-
- {content &&
{content}
}
- {extraContent &&
{extraContent}
}
-
+
+ {value => {
+ return (
+
+ {title}
+
+ }
+ key="pageheader"
+ {...restProps}
+ breadcrumb={conversionBreadcrumbList({
+ ...value,
+ ...restProps,
+ home: ,
+ })}
+ className={styles.pageHeader}
+ linkElement={Link}
+ footer={renderFooter(restProps)}
+ >
+
+ {logo &&
{logo}
}
+
+
+ {content &&
{content}
}
+ {extraContent &&
{extraContent}
}
-
- );
- }}
-
- )}
+
+
+ );
+ }}
+
{children ? (
{children}
diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js
index 3b4ae35c112b1f6d5ab5c2be017e85a7dd6c5973..dc070197b13f19fba1ead888b8840bd09c251c54 100644
--- a/src/layouts/BasicLayout.js
+++ b/src/layouts/BasicLayout.js
@@ -86,7 +86,11 @@ class BasicLayout extends React.Component {
renderSettingDrawer = () => {
// Do not render SettingDrawer in production
// unless it is deployed in preview.pro.ant.design as demo
- if (process.env.NODE_ENV === 'production' && APP_TYPE !== 'site') {
+ // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
+ if (
+ process.env.NODE_ENV === 'production' &&
+ ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION !== 'site'
+ ) {
return null;
}
return ;
diff --git a/src/locales/en-US/login.js b/src/locales/en-US/login.js
index 82c1c20f87281c58357e0242b8290d7016e7a4a1..195e59ce3239c64a33ed2d676bca7371bf376369 100644
--- a/src/locales/en-US/login.js
+++ b/src/locales/en-US/login.js
@@ -12,6 +12,8 @@ export default {
'app.login.login': 'Login',
'app.register.register': 'Register',
'app.register.get-verification-code': 'Get code',
+ 'app.login.verification-code-warning':
+ 'This project is a demo project and will not actually send you a verification code. Please switch to the account password login interface and log in as prompted.',
'app.register.sign-in': 'Already have an account?',
'app.register-result.msg': 'Account:registered at {email}',
'app.register-result.activation-email':
diff --git a/src/locales/pt-BR/login.js b/src/locales/pt-BR/login.js
index 453b3dac19c7a73d7776ed8163d27a59bca65de1..5e2d86954a2c0ee5d88046ebfbb6b008c866ccc9 100644
--- a/src/locales/pt-BR/login.js
+++ b/src/locales/pt-BR/login.js
@@ -13,6 +13,8 @@ export default {
'app.login.login': 'Login',
'app.register.register': 'Cadastro',
'app.register.get-verification-code': 'Recuperar código',
+ 'app.login.verification-code-warning':
+ 'This project is a demo project and will not actually send you a verification code. Please switch to the account password login interface and log in as prompted.',
'app.register.sign-in': 'Já tem uma conta?',
'app.register-result.msg': 'Conta:registrada em {email}',
'app.register-result.activation-email':
diff --git a/src/locales/zh-CN/login.js b/src/locales/zh-CN/login.js
index eb227207334ed3ea6e765313fad1f23b3d724dfc..e211e2cf282e5db88309693255208a4cfb439e05 100644
--- a/src/locales/zh-CN/login.js
+++ b/src/locales/zh-CN/login.js
@@ -12,6 +12,8 @@ export default {
'app.login.login': '登录',
'app.register.register': '注册',
'app.register.get-verification-code': '获取验证码',
+ 'app.login.verification-code-warning':
+ '此项目为演示项目,并不会真的给您发送验证码。请切换到账户密码登录界面按提示登录。',
'app.register.sign-in': '使用已有账户登录',
'app.register-result.msg': '你的账户:{email} 注册成功',
'app.register-result.activation-email':
diff --git a/src/locales/zh-TW/login.js b/src/locales/zh-TW/login.js
index ec5706a6c26e40c5029fb80ab2390b54e483cc69..fb916603913281e88e0dce927d84ff9335d1b0ea 100644
--- a/src/locales/zh-TW/login.js
+++ b/src/locales/zh-TW/login.js
@@ -12,6 +12,8 @@ export default {
'app.login.login': '登錄',
'app.register.register': '註冊',
'app.register.get-verification-code': '獲取驗證碼',
+ 'app.login.verification-code-warning':
+ '此項目為演示項目,並不會真的給您發送驗證碼。請切換到賬戶密碼登錄界面按提示登錄。',
'app.register.sign-in': '使用已有賬戶登錄',
'app.register-result.msg': '妳的賬戶:{email} 註冊成功',
'app.register-result.activation-email':
diff --git a/src/models/setting.js b/src/models/setting.js
index 171da48d1ef5c3068f256b02ff617dae8e4a5908..3956ed3d0f95732180ee1ee1527f461f9dfc5e0f 100644
--- a/src/models/setting.js
+++ b/src/models/setting.js
@@ -4,7 +4,8 @@ import defaultSettings from '../defaultSettings';
let lessNodesAppended;
const updateTheme = primaryColor => {
// Don't compile less in production!
- if (APP_TYPE !== 'site') {
+ // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
+ if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION !== 'site') {
return;
}
// Determine if the component is remounted
diff --git a/src/pages/User/Login.js b/src/pages/User/Login.js
index e3498bd3e4fc9ceafae9f5e3af63a1b066ef681a..29f59c89377d4c35065cf09592105b52aa64ba59 100644
--- a/src/pages/User/Login.js
+++ b/src/pages/User/Login.js
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { connect } from 'dva';
import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link';
-import { Checkbox, Alert, Icon } from 'antd';
+import { Checkbox, Alert, message, Icon } from 'antd';
import Login from '@/components/Login';
import styles from './Login.less';
@@ -35,6 +35,7 @@ class LoginPage extends Component {
})
.then(resolve)
.catch(reject);
+ message.warning(formatMessage({ id: 'app.login.verification-code-warning' }));
}
});
});
diff --git a/src/pages/User/Register.js b/src/pages/User/Register.js
index d685965f5f3da55b4a63fbce3ebc4c46a9bf0880..6aab8ffb6c70a4f286c5e3556d2828616c7bf28c 100644
--- a/src/pages/User/Register.js
+++ b/src/pages/User/Register.js
@@ -3,7 +3,7 @@ import { connect } from 'dva';
import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link';
import router from 'umi/router';
-import { Form, Input, Button, Select, Row, Col, Popover, Progress } from 'antd';
+import { Form, Input, Button, message, Select, Row, Col, Popover, Progress } from 'antd';
import styles from './Register.less';
const FormItem = Form.Item;
@@ -75,6 +75,7 @@ class Register extends Component {
clearInterval(this.interval);
}
}, 1000);
+ message.warning(formatMessage({ id: 'app.login.verification-code-warning' }));
};
getPasswordStatus = () => {
diff --git a/src/utils/authority.js b/src/utils/authority.js
index 288c1e68adc9381a821ba1032cb068791e0184ee..bb1aa23bc6156a94173a0477e1f8d45b937d2c91 100644
--- a/src/utils/authority.js
+++ b/src/utils/authority.js
@@ -1,6 +1,4 @@
// use localStorage to store the authority info, which might be sent from server in actual project.
-const { NODE_ENV } = process.env;
-
export function getAuthority(str) {
// return localStorage.getItem('antd-pro-authority') || ['admin', 'user'];
const authorityString =
@@ -15,12 +13,12 @@ export function getAuthority(str) {
if (typeof authority === 'string') {
return [authority];
}
- if (!authority && NODE_ENV !== 'production') {
+ // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
+ if (!authority && ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
return ['admin'];
}
return authority;
}
-
export function setAuthority(authority) {
const proAuthority = typeof authority === 'string' ? [authority] : authority;
return localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority));
diff --git a/src/utils/authority.test.js b/src/utils/authority.test.js
index 8a6cd41f37f9c797adaef9304f87fe3afd279123..15b3cb951465ecbbc3aa922635208895177f487a 100644
--- a/src/utils/authority.test.js
+++ b/src/utils/authority.test.js
@@ -2,7 +2,7 @@ import { getAuthority } from './authority';
describe('getAuthority should be strong', () => {
it('empty', () => {
- expect(getAuthority(null)).toEqual(['admin']); // default value
+ expect(getAuthority(null)).toEqual(null); // default value
});
it('string', () => {
expect(getAuthority('admin')).toEqual(['admin']);