Commit 851262aa authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试问题修复

parent db3e8fa2
...@@ -68,6 +68,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout ...@@ -68,6 +68,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
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); message.error('Please Re Login!', 3);
// console.log('未登录返回登录页!'); // console.log('未登录返回登录页!');
......
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
address: tmp.addressAndpostalCode, address: tmp.addressAndpostalCode,
home: tmp.buildingNumber + '#' + tmp.floorNumber + '-' + tmp.roomNumber, home: tmp.buildingNumber + '#' + tmp.floorNumber + '-' + tmp.roomNumber,
name: tmp.owerName, name: tmp.owerName,
phone: tmp.accountLogin != null ? tmp.accountLogin : tmp.owerPhone, phone: tmp.owerPhone,
email: tmp.owerEmail, email: tmp.owerEmail,
content: resp.data.serviceContent, content: resp.data.serviceContent,
replyContent: resp.data.replyContent, replyContent: resp.data.replyContent,
......
...@@ -67,6 +67,8 @@ const Model: LoginModelType = { ...@@ -67,6 +67,8 @@ const Model: LoginModelType = {
console.log(userMessage); console.log(userMessage);
console.log(userMessage.token); console.log(userMessage.token);
setCookie('token', userMessage.token); setCookie('token', userMessage.token);
setCookie('name', userMessage.userModel.tosUserName);
setCookie('phone', userMessage.userModel.tosUserPhone);
localStorage.setItem('permission', JSON.stringify(userMessage.permission)); localStorage.setItem('permission', JSON.stringify(userMessage.permission));
console.log('获取到Token:' + getCookie('token')); console.log('获取到Token:' + getCookie('token'));
yield put({ yield put({
......
...@@ -103,7 +103,7 @@ const CardAdd = (props: any) => { ...@@ -103,7 +103,7 @@ const CardAdd = (props: any) => {
className={styles.buildNumber} className={styles.buildNumber}
rules={[{ required: true, validator: checkData }]} rules={[{ required: true, validator: checkData }]}
> >
<Input style={{ width: 80 }} placeholder={'Building'} /> <Input style={{ width: 80 }} placeholder={'BLK'} />
</Form.Item> </Form.Item>
<div style={{ lineHeight: 2, marginRight: 16 }}>#</div> <div style={{ lineHeight: 2, marginRight: 16 }}>#</div>
<Form.Item <Form.Item
......
...@@ -77,6 +77,8 @@ const Detail = (props: any) => { ...@@ -77,6 +77,8 @@ const Detail = (props: any) => {
fromRef.current.setFieldsValue(tmp); fromRef.current.setFieldsValue(tmp);
} }
setLoading(false); setLoading(false);
} else {
history.back();
} }
}, [CurDataDetail]); }, [CurDataDetail]);
...@@ -119,9 +121,7 @@ const Detail = (props: any) => { ...@@ -119,9 +121,7 @@ const Detail = (props: any) => {
{CurDataDetail.address}{' '} {CurDataDetail.address}{' '}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="User Name">{CurDataDetail.name}</Descriptions.Item> <Descriptions.Item label="User Name">{CurDataDetail.name}</Descriptions.Item>
<Descriptions.Item label="Contact Details"> <Descriptions.Item label="Contact Details">{CurDataDetail.phone}</Descriptions.Item>
{CurDataDetail.phone}{' '}
</Descriptions.Item>
<Descriptions.Item>{CurDataDetail.email}</Descriptions.Item> <Descriptions.Item>{CurDataDetail.email}</Descriptions.Item>
</Descriptions> </Descriptions>
<Row gutter={16}> <Row gutter={16}>
......
...@@ -57,7 +57,7 @@ const PropertyServices = (props: any) => { ...@@ -57,7 +57,7 @@ const PropertyServices = (props: any) => {
), ),
}, },
{ {
title: 'Handle status', title: 'Handle Status',
dataIndex: 'id', dataIndex: 'id',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> {handle_Status[record.handle_status][1]}</Space> <Space size="middle"> {handle_Status[record.handle_status][1]}</Space>
......
...@@ -85,6 +85,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -85,6 +85,7 @@ const Login: React.FC<LoginProps> = (props) => {
const onGetCaptcha = useCallback(async (email: string) => { const onGetCaptcha = useCallback(async (email: string) => {
// getFakeCaptcha // getFakeCaptcha
// getCaptcha // getCaptcha
message.success('Has Been Sent!');
const result = await getCaptcha({ account: email }); const result = await getCaptcha({ account: email });
console.log(result); console.log(result);
...@@ -92,7 +93,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -92,7 +93,7 @@ const Login: React.FC<LoginProps> = (props) => {
if (result === false) { if (result === false) {
return; return;
} }
message.success('获取验证码成功!验证码为:1234');
setTiming(true); setTiming(true);
}, []); }, []);
...@@ -144,7 +145,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -144,7 +145,7 @@ const Login: React.FC<LoginProps> = (props) => {
</div> </div>
) : ( ) : (
<div> <div>
<Form.Item name="password"> <Form.Item name="password" initialValue={userName || ''}>
<input className={styles.input2} type="password" /> <input className={styles.input2} type="password" />
</Form.Item> </Form.Item>
<div> <div>
......
...@@ -2,11 +2,9 @@ import { reloadAuthorized } from './Authorized'; ...@@ -2,11 +2,9 @@ import { reloadAuthorized } from './Authorized';
// use localStorage to store the authority info, which might be sent from server in actual project. // use localStorage to store the authority info, which might be sent from server in actual project.
export function getAuthority(str?: string): string | string[] { export function getAuthority(str?: string): string | string[] {
console.log("获取权限")
const authorityString = const authorityString =
typeof str === 'undefined' && localStorage ? localStorage.getItem('antd-pro-authority') : str; typeof str === 'undefined' && localStorage ? localStorage.getItem('antd-pro-authority') : str;
// authorityString could be admin, "admin", ["admin"] // authorityString could be admin, "admin", ["admin"]
console.log(authorityString)
let authority; let authority;
try { try {
if (authorityString) { if (authorityString) {
...@@ -17,7 +15,7 @@ export function getAuthority(str?: string): string | string[] { ...@@ -17,7 +15,7 @@ export function getAuthority(str?: string): string | string[] {
} }
if (typeof authority === 'string') { if (typeof authority === 'string') {
// return [authority]; // return [authority];
return ['admin']; return ['admin'];
} }
// preview.pro.ant.design only do not use in your production. // preview.pro.ant.design only do not use in your production.
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 // preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
...@@ -26,7 +24,7 @@ export function getAuthority(str?: string): string | string[] { ...@@ -26,7 +24,7 @@ export function getAuthority(str?: string): string | string[] {
return ['admin']; return ['admin'];
} }
// return authority; // return authority;
return ['admin']; return ['admin'];
} }
export function setAuthority(authority: string | string[]): void { export function setAuthority(authority: string | string[]): void {
......
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