Commit 7ba2ef55 authored by cellee's avatar cellee

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi.git into final

parents 3708790d b8eb9c86
......@@ -6,7 +6,6 @@ import { ConnectState } from '@/models/connect';
import { CurrentUser } from '@/models/user';
import login from '@/pages/user/login';
import { getCookie } from '@/utils/method';
import { message } from 'antd';
interface SecurityLayoutProps extends ConnectProps {
loading?: boolean;
......@@ -45,18 +44,15 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
render() {
const { isReady, token } = this.state;
const { children, loading, currentUser, login, history, location } = this.props;
const { children, loading, currentUser, login } = this.props;
// You can replace it to your authentication rule (such as check token exists)
// 你可以把它替换成你自己的登录认证规则(比如判断 token 是否存在)
// console.log('是否已登录' + getCookie('token'));
// console.log("是否已登录" + getCookie("token"))
// const isLogin = currentUser && currentUser.name;//isLogin为关键点
var isLogin = false;
if (getCookie('token').length != 0) {
// console.log('是否有权限');
isLogin = true;
}
......@@ -65,13 +61,10 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
});
if ((!isLogin && loading) || !isReady) {
console.log('页面加载');
// console.log("页面加载")
return <PageLoading />;
}
console.log(window.location.pathname);
if (!isLogin && window.location.pathname !== '/user/login') {
message.error('Please Re Login!', 3);
// console.log('未登录返回登录页!');
return <Redirect to={`/user/login?${queryString}`} />;
}
return children;
......
......@@ -68,22 +68,16 @@ const Detail = (props: any) => {
}, []);
useEffect(() => {
console.log(CurDataDetail);
if (CurDataDetail != null && curString.readyState == true) {
console.log('@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
console.log(CurDataDetail);
if (!editorFlag) {
var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl };
fromRef.current.setFieldsValue(tmp);
}
setLoading(false);
} else {
history.back();
}
}, [CurDataDetail]);
const onFinish = (values: any) => {
console.log(values);
var val = values;
val.handleName = getCookie('name');
val.handleContacts = getCookie('phone');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment