Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maple
TOSTUMI
Commits
7ba2ef55
Commit
7ba2ef55
authored
Nov 12, 2020
by
cellee
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'final' of
http://120.77.240.215:9701/Maple/tostumi.git
into final
parents
3708790d
b8eb9c86
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
16 deletions
+3
-16
SecurityLayout.tsx
src/layouts/SecurityLayout.tsx
+3
-10
Detail.tsx
src/pages/CommercialService/Detail.tsx
+0
-6
No files found.
src/layouts/SecurityLayout.tsx
View file @
7ba2ef55
...
...
@@ -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
;
...
...
src/pages/CommercialService/Detail.tsx
View file @
7ba2ef55
...
...
@@ -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'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment