Commit b8eb9c86 authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试问题处理

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