Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
elegantDeepKinase
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangshufen
elegantDeepKinase
Commits
72f1dc61
Commit
72f1dc61
authored
Feb 08, 2023
by
wangshufen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed:修改request.js token校验
parent
a05cccab
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
643 additions
and
696 deletions
+643
-696
src/components/SiderNav/index.js
+10
-10
src/routes/Home/TargetDetails/index.js
+1
-1
src/routes/Kinase/IndicationDetails/index.js
+75
-93
src/routes/Kinase/TargetDetails/index.js
+9
-5
src/routes/drugbank/TargetDetails/index.js
+1
-1
src/routes/drugbank/index.js
+499
-551
src/utils/request.js
+48
-35
No files found.
src/components/SiderNav/index.js
View file @
72f1dc61
...
@@ -12,16 +12,16 @@ const menus = [
...
@@ -12,16 +12,16 @@ const menus = [
icon
:
'search'
,
icon
:
'search'
,
key
:
'/Kinase'
,
key
:
'/Kinase'
,
},
},
{
//
{
title
:
'PDB小分子搜索'
,
//
title: 'PDB小分子搜索',
icon
:
'search'
,
//
icon: 'search',
key
:
'/MolecularSearch'
,
//
key: '/MolecularSearch',
},
//
},
{
//
{
title
:
'分子对接'
,
//
title: '分子对接',
icon
:
''
,
//
icon: '',
key
:
'/dockingUploadDetails'
,
//
key: '/dockingUploadDetails',
},
//
},
{
{
title
:
'Drugbank'
,
title
:
'Drugbank'
,
icon
:
'medicine-box'
,
icon
:
'medicine-box'
,
...
...
src/routes/Home/TargetDetails/index.js
View file @
72f1dc61
...
@@ -684,7 +684,7 @@ export default class TargetDetails extends Component {
...
@@ -684,7 +684,7 @@ export default class TargetDetails extends Component {
columns
=
{
columnsMutation
}
columns
=
{
columnsMutation
}
/
>
/
>
<
/Panel
>
<
/Panel
>
<
Panel
header
=
"Drug & Clinical i
m
formation"
key
=
"4"
>
<
Panel
header
=
"Drug & Clinical i
n
formation"
key
=
"4"
>
<
Table
<
Table
bordered
bordered
rowKey
=
'item'
rowKey
=
'item'
...
...
src/routes/Kinase/IndicationDetails/index.js
View file @
72f1dc61
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
;
import
{
Pagination
,
message
,
Button
,
Tabs
,
Spin
,
Table
,
Tag
,
Typography
}
from
'antd'
import
{
Pagination
,
message
,
Button
,
Tabs
,
Spin
,
Table
,
Tag
,
Typography
}
from
'antd'
;
import
request
from
'../../../utils/request'
import
request
from
'../../../utils/request'
;
import
'./index.css'
import
'./index.css'
;
import
qs
from
'qs'
import
qs
from
'qs'
;
const
{
Title
}
=
Typography
const
{
Title
}
=
Typography
;
export
default
class
IndicationDetails
extends
Component
{
export
default
class
IndicationDetails
extends
Component
{
state
=
{
state
=
{
IndicationList
:
[],
IndicationList
:
[],
smilesData
:
qs
.
parse
(
this
.
props
.
location
.
search
.
slice
(
1
)),
smilesData
:
qs
.
parse
(
this
.
props
.
location
.
search
.
slice
(
1
)),
total_num
:
0
total_num
:
0
,
};
componentDidMount
()
{
this
.
getDetails
();
}
}
componentDidMount
()
{
getDetails
()
{
this
.
getDetails
()
this
.
setState
({
loading
:
true
});
}
request
getDetails
()
{
.
post
(
'/kinase/indication_search'
,
this
.
state
.
smilesData
)
this
.
setState
({
loading
:
true
})
.
then
((
res
)
=>
{
request
.
post
(
'/kinase/indication_search'
,
this
.
state
.
smilesData
)
this
.
setState
({
loading
:
false
});
.
then
(
res
=>
{
this
.
setState
({
loading
:
false
})
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
this
.
setState
({
IndicationList
:
res
.
data
.
data
})
this
.
setState
({
IndicationList
:
res
.
data
.
data
});
this
.
setState
({
total_num
:
res
.
data
.
total_num
})
this
.
setState
({
total_num
:
res
.
data
.
total_num
});
}
else
{
}
else
{
message
.
error
(
res
.
data
.
msg
)
message
.
error
(
res
.
data
.
msg
)
;
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
console
.
error
(
err
)
console
.
error
(
err
)
;
})
})
;
}
}
onShowSizeChange
=
(
current
,
pageSize
)
=>
{
onShowSizeChange
=
(
current
,
pageSize
)
=>
{
let
smilesData
=
this
.
state
.
smilesData
;
let
smilesData
=
this
.
state
.
smilesData
smilesData
.
page
=
current
;
smilesData
.
page
=
current
smilesData
.
page_size
=
pageSize
;
smilesData
.
page_size
=
pageSize
this
.
setState
({
this
.
setState
({
smilesData
smilesData
,
})
})
;
this
.
getDetails
()
this
.
getDetails
()
;
}
}
;
onChange
=
(
current
,
pageSize
)
=>
{
onChange
=
(
current
,
pageSize
)
=>
{
let
smilesData
=
this
.
state
.
smilesData
;
let
smilesData
=
this
.
state
.
smilesData
smilesData
.
page
=
current
;
smilesData
.
page
=
current
smilesData
.
page_size
=
pageSize
;
smilesData
.
page_size
=
pageSize
this
.
setState
({
this
.
setState
({
smilesData
smilesData
,
})
});
this
.
getDetails
()
this
.
getDetails
();
};
}
getOne
(
e
)
{
getOne
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
)
const
{
dataid
,
datatype
}
=
e
;
const
{
dataid
,
datatype
}
=
e
let
data
=
{
let
data
=
{
dataid
,
dataid
,
datatype
datatype
,
}
};
this
.
props
.
history
.
push
({
pathname
:
'/home/SearchDetails'
,
search
:
qs
.
stringify
(
data
)
})
this
.
props
.
history
.
push
({
pathname
:
'/kinase/SearchDetails'
,
search
:
qs
.
stringify
(
data
)
});
}
}
getOne2
(
e
)
{
getOne2
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
;
const
{
dataid
,
datatype
}
=
e
const
{
dataid
,
datatype
}
=
e
;
let
data
=
{
let
data
=
{
dataid
,
dataid
,
datatype
datatype
,
}
};
this
.
props
.
history
.
push
({
pathname
:
'/home/TargetDetails'
,
search
:
qs
.
stringify
(
data
)
})
this
.
props
.
history
.
push
({
pathname
:
'/kinase/TargetDetails'
,
search
:
qs
.
stringify
(
data
)
});
}
}
getReferences
=
(
e
)
=>
{
getReferences
=
(
e
)
=>
{
window
.
open
(
e
)
window
.
open
(
e
)
;
}
}
;
render
()
{
render
()
{
const
columns
=
[
const
columns
=
[
{
{
title
:
'indicationName'
,
title
:
'indicationName'
,
...
@@ -111,13 +97,17 @@ export default class IndicationDetails extends Component {
...
@@ -111,13 +97,17 @@ export default class IndicationDetails extends Component {
title
:
'Drug'
,
title
:
'Drug'
,
dataIndex
:
'Drug'
,
dataIndex
:
'Drug'
,
key
:
'Drug'
,
key
:
'Drug'
,
render
:
Drug
=>
(
render
:
(
Drug
)
=>
(
<
span
>
<
span
>
{
{
<
Tag
color
=
"blue"
onClick
=
{()
=>
{
this
.
getOne
(
Drug
)
}}
>
<
Tag
{(
Drug
.
name
)}
color
=
'blue'
onClick
=
{()
=>
{
this
.
getOne
(
Drug
);
}}
>
{
Drug
.
name
}
<
/Tag
>
<
/Tag
>
}
}
<
/span
>
<
/span
>
),
),
...
@@ -150,42 +140,34 @@ export default class IndicationDetails extends Component {
...
@@ -150,42 +140,34 @@ export default class IndicationDetails extends Component {
{
{
title
:
'References'
,
title
:
'References'
,
dataIndex
:
'References'
,
dataIndex
:
'References'
,
render
:
References
=>
(
render
:
(
References
)
=>
(
<
span
>
<
span
>
{
References
.
map
(
item
=>
{
{
References
.
map
(
(
item
)
=>
{
return
(
return
(
<
Tag
color
=
"blue"
key
=
{
item
}
onClick
=
{()
=>
{
this
.
getReferences
(
item
)
}}
>
<
Tag
color
=
'blue'
key
=
{
item
}
onClick
=
{()
=>
{
this
.
getReferences
(
item
);
}}
>
{
item
.
toUpperCase
()}
{
item
.
toUpperCase
()}
<
/Tag
>
<
/Tag
>
)
)
;
})}
})}
<
/span
>
<
/span
>
),
),
},
},
]
]
;
const
{
IndicationList
,
total_num
}
=
this
.
state
const
{
IndicationList
,
total_num
}
=
this
.
state
;
return
(
return
(
<
div
className
=
'IndicationDetails-div'
>
<
div
className
=
'IndicationDetails-div'
>
<
Title
>
{
IndicationList
.
name
}
<
/Title
>
<
Title
>
{
IndicationList
.
name
}
<
/Title
>
<
Table
<
Table
bordered
rowKey
=
'item'
dataSource
=
{
IndicationList
}
pagination
=
{
false
}
columns
=
{
columns
}
/
>
bordered
rowKey
=
'item'
dataSource
=
{
IndicationList
}
pagination
=
{
false
}
columns
=
{
columns
}
/
>
<
div
className
=
'bottom-div'
>
<
div
className
=
'bottom-div'
>
<
Pagination
<
Pagination
showSizeChanger
onShowSizeChange
=
{
this
.
onShowSizeChange
}
onChange
=
{
this
.
onChange
}
total
=
{
total_num
}
/
>
showSizeChanger
onShowSizeChange
=
{
this
.
onShowSizeChange
}
onChange
=
{
this
.
onChange
}
total
=
{
total_num
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
)
;
}
}
}
}
src/routes/Kinase/TargetDetails/index.js
View file @
72f1dc61
...
@@ -1144,7 +1144,7 @@ export default class TargetDetails extends Component {
...
@@ -1144,7 +1144,7 @@ export default class TargetDetails extends Component {
<
Link
href
=
'#Sequence'
title
=
'Sequence'
/>
<
Link
href
=
'#Sequence'
title
=
'Sequence'
/>
<
Link
href
=
'#Structure'
title
=
'Structure'
/>
<
Link
href
=
'#Structure'
title
=
'Structure'
/>
<
Link
href
=
'#Mutation'
title
=
'Mutation'
/>
<
Link
href
=
'#Mutation'
title
=
'Mutation'
/>
<
Link
href
=
'#Drug'
title
=
'Drug & Clinical i
m
formation'
/>
<
Link
href
=
'#Drug'
title
=
'Drug & Clinical i
n
formation'
/>
<
Link
href
=
'#Bioassay'
title
=
'Bioassay'
/>
<
Link
href
=
'#Bioassay'
title
=
'Bioassay'
/>
<
/Anchor
>
<
/Anchor
>
<
/div
>
<
/div
>
...
@@ -1261,9 +1261,13 @@ export default class TargetDetails extends Component {
...
@@ -1261,9 +1261,13 @@ export default class TargetDetails extends Component {
{
/* {PanelList} */
}
{
/* {PanelList} */
}
<
Collapse
defaultActiveKey
=
{[
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
]}
onChange
=
{
this
.
callback
}
>
<
Collapse
defaultActiveKey
=
{[
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
]}
onChange
=
{
this
.
callback
}
>
<
Panel
header
=
'Sequence'
key
=
'1'
id
=
'Sequence'
>
<
Panel
header
=
'Sequence'
key
=
'1'
id
=
'Sequence'
>
<
Button
type
=
'primary'
onClick
=
{
this
.
alignmentEve
}
>
<
div
>
alignment
<
Button
type
=
'primary'
onClick
=
{
this
.
alignmentEve
}
>
<
/Button
>
alignment
<
/Button
>
<
div
style
=
{{
width
:
'90%'
,
overflow
:
'scroll'
}}
>
{
targetsDetail
.
SequenceStr
}
<
/div
>
<
/div
>
<
div
className
=
'Sequence-div'
>
<
div
className
=
'Sequence-div'
>
{
targetsDetail
.
Sequence
&&
{
targetsDetail
.
Sequence
&&
targetsDetail
.
Sequence
.
map
((
item
,
index
)
=>
{
targetsDetail
.
Sequence
.
map
((
item
,
index
)
=>
{
...
@@ -1451,7 +1455,7 @@ export default class TargetDetails extends Component {
...
@@ -1451,7 +1455,7 @@ export default class TargetDetails extends Component {
<
Table
bordered
rowKey
=
'item'
dataSource
=
{
targetsDetail
.
MutationList
}
pagination
=
{
false
}
columns
=
{
columnsMutation
}
onChange
=
{
this
.
onChangeTable
}
/
>
<
Table
bordered
rowKey
=
'item'
dataSource
=
{
targetsDetail
.
MutationList
}
pagination
=
{
false
}
columns
=
{
columnsMutation
}
onChange
=
{
this
.
onChangeTable
}
/
>
<
Pagination
showSizeChanger
onShowSizeChange
=
{
this
.
onShowSizeChange
}
onChange
=
{
this
.
onChange
}
total
=
{
total_num
}
/
>
<
Pagination
showSizeChanger
onShowSizeChange
=
{
this
.
onShowSizeChange
}
onChange
=
{
this
.
onChange
}
total
=
{
total_num
}
/
>
<
/Panel
>
<
/Panel
>
<
Panel
header
=
'Drug & Clinical i
m
formation'
key
=
'4'
id
=
'Drug'
>
<
Panel
header
=
'Drug & Clinical i
n
formation'
key
=
'4'
id
=
'Drug'
>
<
Table
bordered
rowKey
=
'item'
dataSource
=
{
targetsDetail
.
DrugsInformation
}
pagination
=
{
false
}
expandedRowRender
=
{
expandedRowRender
}
columns
=
{
columnsDrug
}
/
>
<
Table
bordered
rowKey
=
'item'
dataSource
=
{
targetsDetail
.
DrugsInformation
}
pagination
=
{
false
}
expandedRowRender
=
{
expandedRowRender
}
columns
=
{
columnsDrug
}
/
>
<
Pagination
showSizeChanger
onShowSizeChange
=
{
this
.
onShowSizeChange3
}
onChange
=
{
this
.
onChange3
}
total
=
{
total_num3
}
/
>
<
Pagination
showSizeChanger
onShowSizeChange
=
{
this
.
onShowSizeChange3
}
onChange
=
{
this
.
onChange3
}
total
=
{
total_num3
}
/
>
<
/Panel
>
<
/Panel
>
...
...
src/routes/drugbank/TargetDetails/index.js
View file @
72f1dc61
...
@@ -777,7 +777,7 @@ export default class TargetDetails extends Component {
...
@@ -777,7 +777,7 @@ export default class TargetDetails extends Component {
})}
})}
<
/Tabs
>
<
/Tabs
>
<
/Panel
>
<
/Panel
>
<
Panel
header
=
"Drug&Clinical i
m
formation"
key
=
"6"
>
<
Panel
header
=
"Drug&Clinical i
n
formation"
key
=
"6"
>
<
Table
<
Table
bordered
bordered
rowKey
=
"item"
rowKey
=
"item"
...
...
src/routes/drugbank/index.js
View file @
72f1dc61
import
React
from
'react'
import
React
from
'react'
;
import
{
Form
,
Input
,
Button
,
Select
,
Tabs
,
message
,
Radio
,
Checkbox
,
Row
,
Col
}
from
'antd'
;
import
{
Form
,
Input
,
Button
,
Select
,
Tabs
,
message
,
Radio
,
Checkbox
,
Row
,
Col
}
from
'antd'
;
import
LogoTitlte
from
'../../components/LogoTitlte/index'
import
LogoTitlte
from
'../../components/LogoTitlte/index'
;
import
{
Jsme
}
from
'jsme-react'
import
{
Jsme
}
from
'jsme-react'
;
import
qs
from
'qs'
import
qs
from
'qs'
;
import
request
from
'../../utils/request'
import
request
from
'../../utils/request'
;
import
'./style.css'
import
'./style.css'
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
class
Home
extends
React
.
Component
{
class
Home
extends
React
.
Component
{
state
=
{
state
=
{
select_db
:
'Ligands'
,
select_db
:
'Ligands'
,
data
:
''
,
data
:
''
,
page
:
1
,
page
:
1
,
page_size
:
10
,
page_size
:
10
,
data_type
:
'smile'
,
data_type
:
'smile'
,
target_class
:
''
,
target_class
:
''
,
// target_families:'',
// target_families:'',
searchData
:{
searchData
:
{
name
:
'Drug'
,
name
:
'Drug'
,
drugs_data
:
''
,
drugs_data
:
''
,
target_data
:
''
,
target_data
:
''
,
indication
:
''
,
indication
:
''
,
pdb_status
:
0
,
pdb_status
:
0
,
page
:
1
,
page
:
1
,
page_size
:
10
page_size
:
10
,
},
},
TargetSearchData
:{
TargetSearchData
:
{
name
:
'Target'
,
name
:
'Target'
,
target_data
:
''
,
target_data
:
''
,
pdb_status
:
0
,
pdb_status
:
0
,
page
:
1
,
page
:
1
,
page_size
:
10
page_size
:
10
,
},
ligandSearchData
:
{
},
name
:
'Ligand'
,
ligandSearchData
:{
ligand_data
:
''
,
name
:
'Ligand'
,
target_class
:
'All Groups'
,
ligand_data
:
''
,
target_data
:
''
,
target_class
:
'All Groups'
,
target_families
:
''
,
target_data
:
''
,
pdb_status
:
0
,
target_families
:
''
,
page
:
1
,
pdb_status
:
0
,
page_size
:
10
,
page
:
1
,
},
page_size
:
10
IndicationSearchData
:
{
name
:
'Indication'
,
},
indication
:
''
,
IndicationSearchData
:{
page
:
1
,
name
:
'Indication'
,
page_size
:
10
,
indication
:
''
,
},
page
:
1
,
MutationSearchData
:
{
page_size
:
10
name
:
'Mutation'
,
chembl_id
:
''
,
target_class
:
'All Class'
,
},
target_data
:
''
,
MutationSearchData
:{
target_families
:
''
,
name
:
'Mutation'
,
idselect_data
:
[],
chembl_id
:
''
,
page
:
1
,
target_class
:
'All Class'
,
page_size
:
10
,
target_data
:
''
,
},
target_families
:
''
,
disabled
:
true
,
idselect_data
:[],
loading
:
false
,
page
:
1
,
SelectList
:
[],
page_size
:
10
draw
:
false
,
classList
:
[],
},
classData
:
'All Class'
,
disabled
:
true
,
allClassList
:
{},
loading
:
false
,
childClassList
:
[],
SelectList
:[],
TargetClassList
:
[],
draw
:
false
,
TargetAllClassList
:
[],
classList
:[],
TargetChildClassList
:
[],
classData
:
'All Class'
,
compoundList
:
[
'DrugName'
,
'Smiles'
],
allClassList
:{},
targetList
:
[
'TargetName'
,
'UniprotId'
],
childClassList
:[],
optionsList
:
[{
label
:
'查询drug相关靶点'
,
value
:
1
},
{
label
:
'查询ligand相关靶点'
,
value
:
2
,
disabled
:
false
},
{
label
:
'是否有PDB结构'
,
value
:
3
}],
TargetClassList
:[],
};
TargetAllClassList
:[],
// Mutation
TargetChildClassList
:[],
CheckChange
=
(
e
)
=>
{
compoundList
:[
console
.
log
(
e
);
'DrugName'
,
'Smiles'
],
targetList
:[
'TargetName'
,
'UniprotId'
],
optionsList
:[
{
label
:
'查询drug相关靶点'
,
value
:
1
},
{
label
:
'查询ligand相关靶点'
,
value
:
2
,
disabled
:
false
,
},
{
label
:
'是否有PDB结构'
,
value
:
3
},
]
}
// Mutation
CheckChange
=
(
e
)
=>
{
console
.
log
(
e
);
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
MutationSearchData
.
idselect_data
=
e
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}))
}
onAllChange
=
(
e
)
=>
{
if
(
e
.
target
.
checked
)
{
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
let
all_idselect_data
=
[
"TM1"
,
"TM4"
,
"TM7"
,
"ICL3"
,
"ECL3"
,
"N-Term"
,
"ECL1"
,
"ICL1"
,
"TM5"
,
"TM2"
,
"TM3"
,
"TM6"
,
"ICL2"
,
"ECL2"
,
"C-Term"
]
MutationSearchData
.
idselect_data
=
all_idselect_data
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}))
}
else
{
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
let
all_idselect_data
=
[]
MutationSearchData
.
idselect_data
=
e
;
MutationSearchData
.
idselect_data
=
all_idselect_data
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}));
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}))
};
onAllChange
=
(
e
)
=>
{
}
if
(
e
.
target
.
checked
)
{
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
let
all_idselect_data
=
[
'TM1'
,
'TM4'
,
'TM7'
,
'ICL3'
,
'ECL3'
,
'N-Term'
,
'ECL1'
,
'ICL1'
,
'TM5'
,
'TM2'
,
'TM3'
,
'TM6'
,
'ICL2'
,
'ECL2'
,
'C-Term'
];
MutationSearchData
.
idselect_data
=
all_idselect_data
;
}
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}));
getMutationList
=
()
=>
{
}
else
{
let
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
state
.
MutationSearchData
))
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
data
.
idselect_data
=
data
.
idselect_data
.
toString
()
let
all_idselect_data
=
[];
this
.
setState
(()
=>
({
loading
:
true
}))
MutationSearchData
.
idselect_data
=
all_idselect_data
;
request
.
post
(
'/mutation_search'
,
qs
.
stringify
(
data
)
)
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}));
.
then
(
res
=>
{
this
.
setState
(()
=>
({
loading
:
false
}))
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
data
);
this
.
props
.
history
.
push
({
pathname
:
'/home/SearchList'
,
search
:
qs
.
stringify
(
data
)})
}
else
{
message
.
error
(
res
.
data
.
msg
);
}
})
.
catch
(
err
=>
{
console
.
error
(
err
);
})
}
childClassChange3
=
(
e
)
=>
{
console
.
log
(
e
);
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
MutationSearchData
.
target_families
=
e
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}))
}
getClassData3
=
(
e
)
=>
{
console
.
log
(
e
);
this
.
setState
(()
=>
({
classData
:
e
}))
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
MutationSearchData
.
target_class
=
e
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}))
let
value
=
this
.
state
.
allClassList
let
childData
=
value
[
e
]
console
.
log
(
childData
);
this
.
setState
(()
=>
({
childClassList
:
childData
}))
}
getMutationValue
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
MutationSearchData
.
target_data
=
value
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}))
}
getChemblValue
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
MutationSearchData
.
chembl_id
=
value
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}))
}
// Indication
getIndicationValue
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
let
IndicationSearchData
=
this
.
state
.
IndicationSearchData
;
IndicationSearchData
.
indication
=
value
this
.
setState
(()
=>
({
IndicationSearchData
:
IndicationSearchData
}))
}
getIndicationList
=
()
=>
{
let
data
=
this
.
state
.
IndicationSearchData
this
.
setState
(()
=>
({
loading
:
true
}))
request
.
post
(
'/drugbank/indication_search'
,
qs
.
stringify
(
data
)
)
.
then
(
res
=>
{
this
.
setState
(()
=>
({
loading
:
false
}))
if
(
res
.
data
.
code
===
200
)
{
this
.
props
.
history
.
push
({
pathname
:
'/drugbank/Indication'
,
search
:
qs
.
stringify
(
data
)})
}
else
{
message
.
error
(
res
.
data
.
msg
);
}
}
})
};
.
catch
(
err
=>
{
getMutationList
=
()
=>
{
console
.
error
(
err
);
let
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
state
.
MutationSearchData
));
})
data
.
idselect_data
=
data
.
idselect_data
.
toString
();
}
this
.
setState
(()
=>
({
loading
:
true
}));
request
// ligend
.
post
(
'/mutation_search'
,
qs
.
stringify
(
data
))
getLigendValue
=
(
e
)
=>
{
.
then
((
res
)
=>
{
const
{
value
}
=
e
.
target
;
this
.
setState
(()
=>
({
loading
:
false
}));
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
if
(
res
.
data
.
code
===
200
)
{
ligandSearchData
.
ligand_data
=
value
console
.
log
(
data
);
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}))
this
.
props
.
history
.
push
({
pathname
:
'/home/SearchList'
,
search
:
qs
.
stringify
(
data
)
});
}
else
{
}
message
.
error
(
res
.
data
.
msg
);
}
logSmiles2
=
(
e
)
=>
{
})
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
.
catch
((
err
)
=>
{
ligandSearchData
.
ligand_data
=
e
console
.
error
(
err
);
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}))
});
// this.setState(()=>({data:e }))
};
}
childClassChange3
=
(
e
)
=>
{
getLigandData
=
(
e
)
=>
{
console
.
log
(
e
);
const
{
value
}
=
e
.
target
;
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
MutationSearchData
.
target_families
=
e
;
ligandSearchData
.
target_data
=
value
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}));
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}))
};
getClassData3
=
(
e
)
=>
{
}
console
.
log
(
e
);
ligandChange
=
(
e
)
=>
{
this
.
setState
(()
=>
({
classData
:
e
}));
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
ligandSearchData
.
target_type
=
e
MutationSearchData
.
target_class
=
e
;
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}))
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}));
let
value
=
this
.
state
.
allClassList
;
let
childData
=
value
[
e
];
console
.
log
(
childData
);
this
.
setState
(()
=>
({
childClassList
:
childData
}));
};
getMutationValue
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
MutationSearchData
.
target_data
=
value
;
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}));
};
getChemblValue
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
let
MutationSearchData
=
this
.
state
.
MutationSearchData
;
MutationSearchData
.
chembl_id
=
value
;
this
.
setState
(()
=>
({
MutationSearchData
:
MutationSearchData
}));
};
// Indication
}
getIndicationValue
=
(
e
)
=>
{
childClassChange2
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
console
.
log
(
e
);
let
IndicationSearchData
=
this
.
state
.
IndicationSearchData
;
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
IndicationSearchData
.
indication
=
value
;
ligandSearchData
.
target_families
=
e
this
.
setState
(()
=>
({
IndicationSearchData
:
IndicationSearchData
}));
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}))
};
getIndicationList
=
()
=>
{
let
data
=
this
.
state
.
IndicationSearchData
;
this
.
setState
(()
=>
({
loading
:
true
}));
request
.
post
(
'/drugbank/indication_search'
,
qs
.
stringify
(
data
))
.
then
((
res
)
=>
{
this
.
setState
(()
=>
({
loading
:
false
}));
if
(
res
.
data
.
code
===
200
)
{
this
.
props
.
history
.
push
({
pathname
:
'/drugbank/Indication'
,
search
:
qs
.
stringify
(
data
)
});
}
else
{
message
.
error
(
res
.
data
.
msg
);
}
})
.
catch
((
err
)
=>
{
console
.
error
(
err
);
});
};
}
// ligend
getClassData2
=
(
e
)
=>
{
getLigendValue
=
(
e
)
=>
{
console
.
log
(
e
);
const
{
value
}
=
e
.
target
;
this
.
setState
(()
=>
({
classData
:
e
}))
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
ligandSearchData
.
ligand_data
=
value
;
ligandSearchData
.
target_class
=
e
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}));
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}))
};
let
value
=
this
.
state
.
allClassList
let
childData
=
value
[
e
]
console
.
log
(
childData
);
this
.
setState
(()
=>
({
childClassList
:
childData
}))
}
// Target
getTargetClassData
=
(
e
)
=>
{
this
.
setState
(()
=>
({
classData
:
e
}))
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
target_class
=
e
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}))
let
value
=
this
.
state
.
TargetClassList
value
.
map
((
item
)
=>
{
if
(
item
.
name
===
e
)
{
this
.
setState
(()
=>
({
TargetChildClassList
:
item
.
content
}))
}
})
logSmiles2
=
(
e
)
=>
{
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
ligandSearchData
.
ligand_data
=
e
;
// let childData=value[e]
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}));
// console.log(childData);
// this.setState(()=>({data:e }))
// this.setState(()=>({childClassList:childData}))
};
getLigandData
=
(
e
)
=>
{
}
const
{
value
}
=
e
.
target
;
childTargetClassChange
=
(
e
)
=>
{
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
console
.
log
(
e
);
ligandSearchData
.
target_data
=
value
;
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}));
TargetSearchData
.
target_families
=
e
};
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}))
ligandChange
=
(
e
)
=>
{
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
ligandSearchData
.
target_type
=
e
;
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}));
};
childClassChange2
=
(
e
)
=>
{
console
.
log
(
e
);
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
ligandSearchData
.
target_families
=
e
;
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}));
};
getClassData2
=
(
e
)
=>
{
console
.
log
(
e
);
this
.
setState
(()
=>
({
classData
:
e
}));
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
ligandSearchData
.
target_class
=
e
;
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}));
let
value
=
this
.
state
.
allClassList
;
let
childData
=
value
[
e
];
console
.
log
(
childData
);
this
.
setState
(()
=>
({
childClassList
:
childData
}));
};
// Target
getTargetClassData
=
(
e
)
=>
{
this
.
setState
(()
=>
({
classData
:
e
}));
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
target_class
=
e
;
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
let
value
=
this
.
state
.
TargetClassList
;
value
.
map
((
item
)
=>
{
if
(
item
.
name
===
e
)
{
this
.
setState
(()
=>
({
TargetChildClassList
:
item
.
content
}));
}
});
}
// let childData=value[e]
targetChange
=
(
e
)
=>
{
// console.log(childData);
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
// this.setState(()=>({childClassList:childData}))
TargetSearchData
.
target_type
=
e
};
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}))
childTargetClassChange
=
(
e
)
=>
{
console
.
log
(
e
);
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
target_families
=
e
;
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
};
targetChange
=
(
e
)
=>
{
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
target_type
=
e
;
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
};
getindTargetication
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
indication
=
value
;
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
};
getTargetData2
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
target_data
=
value
;
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
};
get_drug_name
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
drug_name
=
value
;
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
};
getTargetList
=
()
=>
{
let
data
=
this
.
state
.
TargetSearchData
;
}
this
.
setState
(()
=>
({
loading
:
true
}));
getindTargetication
=
(
e
)
=>
{
request
const
{
value
}
=
e
.
target
;
.
post
(
'/drugbank/target_search'
,
qs
.
stringify
(
data
))
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
.
then
((
res
)
=>
{
TargetSearchData
.
indication
=
value
console
.
log
(
res
);
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}))
this
.
setState
(()
=>
({
loading
:
false
}));
if
(
res
.
data
.
code
===
200
)
{
}
this
.
props
.
history
.
push
({
pathname
:
'/drugbank/SearchList'
,
search
:
qs
.
stringify
(
data
)
});
getTargetData2
=
(
e
)
=>
{
}
else
{
const
{
value
}
=
e
.
target
;
message
.
error
(
res
.
data
.
msg
);
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
}
TargetSearchData
.
target_data
=
value
})
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}))
.
catch
((
err
)
=>
{
console
.
error
(
err
);
}
});
get_drug_name
=
(
e
)
=>
{
};
const
{
value
}
=
e
.
target
;
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
drug_name
=
value
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}))
}
getTargetList
=
()
=>
{
let
data
=
this
.
state
.
TargetSearchData
this
.
setState
(()
=>
({
loading
:
true
}))
request
.
post
(
'/drugbank/target_search'
,
qs
.
stringify
(
data
)
)
.
then
(
res
=>
{
console
.
log
(
res
)
this
.
setState
(()
=>
({
loading
:
false
}))
if
(
res
.
data
.
code
===
200
)
{
this
.
props
.
history
.
push
({
pathname
:
'/drugbank/SearchList'
,
search
:
qs
.
stringify
(
data
)})
}
else
{
message
.
error
(
res
.
data
.
msg
);
}
})
.
catch
(
err
=>
{
console
.
error
(
err
);
})
}
onChangeCheckbox
=
(
e
)
=>
{
onChangeCheckbox
=
(
e
)
=>
{
console
.
log
(
e
);
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
select_status
=
e
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}))
console
.
log
(
this
.
state
.
TargetSearchData
);
}
handleChange
=
(
e
)
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
this
.
setState
(()
=>
({
select_db
:
e
}))
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
if
(
e
!=
'Ligands'
)
{
TargetSearchData
.
select_status
=
e
;
this
.
setState
(()
=>
({
data
:
''
}))
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
console
.
log
(
this
.
state
.
TargetSearchData
);
};
handleChange
=
(
e
)
=>
{
console
.
log
(
e
);
this
.
setState
(()
=>
({
select_db
:
e
}));
if
(
e
!=
'Ligands'
)
{
this
.
setState
(()
=>
({
data
:
''
}));
}
}
}
}
;
childClassChange
=
(
e
)
=>
{
childClassChange
=
(
e
)
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
target_families
=
e
searchData
.
target_families
=
e
;
this
.
setState
(()
=>
({
searchData
:
searchData
}))
this
.
setState
(()
=>
({
searchData
:
searchData
}));
};
}
getClassData
=
(
e
)
=>
{
getClassData
=
(
e
)
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
this
.
setState
(()
=>
({
classData
:
e
}))
this
.
setState
(()
=>
({
classData
:
e
}));
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
target_class
=
e
searchData
.
target_class
=
e
;
this
.
setState
(()
=>
({
searchData
:
searchData
}))
this
.
setState
(()
=>
({
searchData
:
searchData
}));
console
.
log
(
this
.
state
.
searchData
);
console
.
log
(
this
.
state
.
searchData
);
let
value
=
this
.
state
.
allClassList
let
value
=
this
.
state
.
allClassList
;
let
childData
=
value
[
e
]
let
childData
=
value
[
e
];
console
.
log
(
childData
);
console
.
log
(
childData
);
this
.
setState
(()
=>
({
childClassList
:
childData
}))
this
.
setState
(()
=>
({
childClassList
:
childData
}));
};
}
targetChange
=
(
e
)
=>
{
targetChange
=
(
e
)
=>
{
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
target_type
=
e
searchData
.
target_type
=
e
;
this
.
setState
(()
=>
({
searchData
:
searchData
}))
this
.
setState
(()
=>
({
searchData
:
searchData
}));
};
}
logSmiles
=
(
e
)
=>
{
logSmiles
=
(
e
)
=>
{
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
drugs_data
=
e
searchData
.
drugs_data
=
e
;
this
.
setState
(()
=>
({
searchData
:
searchData
}))
this
.
setState
(()
=>
({
searchData
:
searchData
}));
// this.setState(()=>({data:e }))
// this.setState(()=>({data:e }))
}
}
;
componentDidMount
(){
componentDidMount
()
{
// this.getList()
// this.getList()
this
.
getSelectList
()
this
.
getSelectList
()
;
this
.
getTargetSelectList
()
this
.
getTargetSelectList
()
;
}
}
getSelectList
=
()
=>
{
getSelectList
=
()
=>
{
request
.
get
(
'/kinase/target_class/drug'
)
request
.
then
(
res
=>
{
.
get
(
'/kinase/target_class/drug'
)
console
.
log
(
res
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
res
);
console
.
log
(
res
.
data
.
data
);
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
res
.
data
.
data
);
this
.
setState
({
classList
:
Object
.
keys
(
res
.
data
.
data
),
allClassList
:
res
.
data
.
data
})
console
.
log
(
this
.
state
);
}
else
{
message
.
error
(
res
.
data
.
msg
);
}
})
.
catch
(
err
=>
{
console
.
error
(
err
);
})
}
this
.
setState
({
getTargetSelectList
=
()
=>
{
classList
:
Object
.
keys
(
res
.
data
.
data
),
request
.
get
(
'/kinase/target_class/target'
)
allClassList
:
res
.
data
.
data
,
.
then
(
res
=>
{
});
console
.
log
(
res
)
console
.
log
(
this
.
state
);
if
(
res
.
data
.
code
===
200
)
{
}
else
{
console
.
log
(
res
.
data
.
data
);
message
.
error
(
res
.
data
.
msg
);
}
this
.
setState
({
})
TargetClassList
:
res
.
data
.
data
,
.
catch
((
err
)
=>
{
TargetAllClassList
:
res
.
data
.
data
console
.
error
(
err
);
});
};
getTargetSelectList
=
()
=>
{
localStorage
.
getItem
(
'token'
)
&&
request
.
get
(
'/kinase/target_class/target'
)
.
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
res
.
data
.
data
);
this
.
setState
({
TargetClassList
:
res
.
data
.
data
,
TargetAllClassList
:
res
.
data
.
data
,
});
console
.
log
(
this
.
state
);
}
else
{
message
.
error
(
res
.
data
.
msg
);
}
})
})
console
.
log
(
this
.
state
);
.
catch
((
err
)
=>
{
}
else
{
console
.
error
(
err
);
message
.
error
(
res
.
data
.
msg
);
});
}
};
})
getValue
=
(
e
)
=>
{
.
catch
(
err
=>
{
console
.
error
(
err
);
})
}
getValue
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
const
{
value
}
=
e
.
target
;
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
drugs_data
=
value
searchData
.
drugs_data
=
value
;
this
.
setState
(()
=>
({
searchData
:
searchData
}))
this
.
setState
(()
=>
({
searchData
:
searchData
}));
};
}
getindication
=
(
e
)
=>
{
getindication
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
const
{
value
}
=
e
.
target
;
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
indication
=
value
searchData
.
indication
=
value
;
this
.
setState
(()
=>
({
searchData
:
searchData
}))
this
.
setState
(()
=>
({
searchData
:
searchData
}));
};
}
getTargetData
=
(
e
)
=>
{
getTargetData
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
;
const
{
value
}
=
e
.
target
;
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
target_data
=
value
searchData
.
target_data
=
value
;
this
.
setState
(()
=>
({
searchData
:
searchData
}))
this
.
setState
(()
=>
({
searchData
:
searchData
}));
};
}
onChangeRadio
=
(
e
)
=>
{
onChangeRadio
=
(
e
)
=>
{
console
.
log
(
e
.
target
.
value
);
console
.
log
(
e
.
target
.
value
);
let
value
=
e
.
target
.
value
let
value
=
e
.
target
.
value
;
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
pdb_status
=
value
searchData
.
pdb_status
=
value
;
this
.
setState
({
this
.
setState
({
searchData
:
searchData
,
searchData
:
searchData
,
});
});
}
}
;
onChangeRadio2
=
(
e
)
=>
{
onChangeRadio2
=
(
e
)
=>
{
let
value
=
e
.
target
.
value
let
value
=
e
.
target
.
value
;
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
let
TargetSearchData
=
this
.
state
.
TargetSearchData
;
TargetSearchData
.
pdb_status
=
value
TargetSearchData
.
pdb_status
=
value
;
this
.
setState
({
this
.
setState
({
TargetSearchData
:
TargetSearchData
,
TargetSearchData
:
TargetSearchData
,
});
});
}
}
;
onChangeRadio3
=
(
e
)
=>
{
onChangeRadio3
=
(
e
)
=>
{
let
value
=
e
.
target
.
value
let
value
=
e
.
target
.
value
;
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
let
ligandSearchData
=
this
.
state
.
ligandSearchData
;
ligandSearchData
.
pdb_status
=
value
ligandSearchData
.
pdb_status
=
value
;
this
.
setState
({
this
.
setState
({
ligandSearchData
:
ligandSearchData
,
ligandSearchData
:
ligandSearchData
,
});
});
}
};
getList
=
()
=>
{
getList
=
()
=>
{
let
data
=
this
.
state
.
searchData
let
data
=
this
.
state
.
searchData
;
request
.
post
(
'/ligand_search'
,
qs
.
stringify
(
data
)
)
request
.
then
(
res
=>
{
.
post
(
'/ligand_search'
,
qs
.
stringify
(
data
))
console
.
log
(
res
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
res
);
this
.
props
.
history
.
push
({
pathname
:
'/home/SearchList'
,
search
:
qs
.
stringify
(
data
)})
if
(
res
.
data
.
code
===
200
)
{
}
else
{
this
.
props
.
history
.
push
({
pathname
:
'/home/SearchList'
,
search
:
qs
.
stringify
(
data
)
});
message
.
error
(
res
.
data
.
msg
);
}
else
{
}
message
.
error
(
res
.
data
.
msg
);
})
}
.
catch
(
err
=>
{
})
console
.
error
(
err
);
.
catch
((
err
)
=>
{
})
console
.
error
(
err
);
}
});
getDrugsList
=
()
=>
{
};
let
data
=
this
.
state
.
searchData
getDrugsList
=
()
=>
{
this
.
setState
(()
=>
({
loading
:
true
}))
let
data
=
this
.
state
.
searchData
;
request
.
post
(
'/drugbank/drug_search'
,
qs
.
stringify
(
data
)
)
this
.
setState
(()
=>
({
loading
:
true
}));
.
then
(
res
=>
{
request
console
.
log
(
res
)
.
post
(
'/drugbank/drug_search'
,
qs
.
stringify
(
data
))
this
.
setState
(()
=>
({
loading
:
false
}))
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
res
);
this
.
props
.
history
.
push
({
pathname
:
'/drugbank/SearchList'
,
search
:
qs
.
stringify
(
data
)})
this
.
setState
(()
=>
({
loading
:
false
}));
}
else
{
if
(
res
.
data
.
code
===
200
)
{
message
.
error
(
res
.
data
.
msg
);
this
.
props
.
history
.
push
({
pathname
:
'/drugbank/SearchList'
,
search
:
qs
.
stringify
(
data
)
});
}
}
else
{
})
message
.
error
(
res
.
data
.
msg
);
.
catch
(
err
=>
{
}
console
.
error
(
err
);
})
})
.
catch
((
err
)
=>
{
}
console
.
error
(
err
);
getDraw
=
()
=>
{
});
this
.
setState
(()
=>
({
draw
:
!
this
.
state
.
draw
}))
};
}
getDraw
=
()
=>
{
compoundChange
=
(
e
)
=>
{
this
.
setState
(()
=>
({
draw
:
!
this
.
state
.
draw
}));
};
compoundChange
=
(
e
)
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
drugs_type
=
e
searchData
.
drugs_type
=
e
;
this
.
setState
(()
=>
({
searchData
:
searchData
}))
this
.
setState
(()
=>
({
searchData
:
searchData
}));
console
.
log
(
this
.
state
.
searchData
)
console
.
log
(
this
.
state
.
searchData
);
};
}
callback
=
(
e
)
=>
{
callback
=
(
e
)
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
let
searchData
=
this
.
state
.
searchData
;
let
searchData
=
this
.
state
.
searchData
;
searchData
.
name
=
e
;
searchData
.
name
=
e
this
.
setState
(()
=>
({
searchData
:
searchData
}));
this
.
setState
(()
=>
({
searchData
:
searchData
}))
console
.
log
(
this
.
state
.
searchData
);
console
.
log
(
this
.
state
.
searchData
);
};
}
getJsme
=
()
=>
{
getJsme
=
()
=>
{
console
.
log
(
1
);
console
.
log
(
1
);
}
}
;
// getTargetList=()=>{
// getTargetList=()=>{
// this.props.history.push({ pathname: '/home/TargetDetails'})
// this.props.history.push({ pathname: '/home/TargetDetails'})
// }
// }
...
@@ -525,14 +479,12 @@ onChangeCheckbox=(e)=>{
...
@@ -525,14 +479,12 @@ onChangeCheckbox=(e)=>{
// this.props.history.push({ pathname: '/home/SearchDetails', search: qs.stringify(data)})
// this.props.history.push({ pathname: '/home/SearchDetails', search: qs.stringify(data)})
// }
// }
render
()
{
render
()
{
const
{
select_db
,
data
,
data_type
,
optionsList
,
draw
,
SelectList
,
targetList
,
classList
,
classData
,
childClassList
,
compoundList
,
TargetClassList
,
TargetChildClassList
}
=
this
.
state
const
{
select_db
,
data
,
data_type
,
optionsList
,
draw
,
SelectList
,
targetList
,
classList
,
classData
,
childClassList
,
compoundList
,
TargetClassList
,
TargetChildClassList
}
=
this
.
state
;
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
span
:
8
},
labelCol
:
{
span
:
8
},
wrapperCol
:
{
span
:
12
},
wrapperCol
:
{
span
:
12
},
}
}
;
const
formTailLayout
=
{
const
formTailLayout
=
{
labelCol
:
{
span
:
8
},
labelCol
:
{
span
:
8
},
wrapperCol
:
{
span
:
12
,
offset
:
8
},
wrapperCol
:
{
span
:
12
,
offset
:
8
},
...
@@ -545,13 +497,13 @@ onChangeCheckbox=(e)=>{
...
@@ -545,13 +497,13 @@ onChangeCheckbox=(e)=>{
<
div
className
=
'home'
>
<
div
className
=
'home'
>
<
div
className
=
'home-div'
>
<
div
className
=
'home-div'
>
{
/* <LogoTitlte></LogoTitlte> */
}
{
/* <LogoTitlte></LogoTitlte> */
}
<
Tabs
onChange
=
{
this
.
callback
}
type
=
"card"
>
<
Tabs
onChange
=
{
this
.
callback
}
type
=
'card'
>
<
TabPane
tab
=
"Drug"
key
=
"Drug"
>
<
TabPane
tab
=
'Drug'
key
=
'Drug'
>
<
div
className
=
'top-div'
>
<
div
className
=
'top-div'
>
<
div
>
<
div
>
<
Form
layout
=
"horizontal"
>
<
Form
layout
=
'horizontal'
>
<
Form
.
Item
label
=
"直接查询药物"
{...
formItemLayout
}
>
<
Form
.
Item
label
=
'直接查询药物'
{...
formItemLayout
}
>
{
/* <Select value={this.state.searchData.drugs_type} style={{ width: 250 }} size="large" onChange={this.compoundChange}>
{
/* <Select value={this.state.searchData.drugs_type} style={{ width: 250 }} size="large" onChange={this.compoundChange}>
{
{
compoundList.map(
compoundList.map(
(item,index)=>{
(item,index)=>{
...
@@ -563,50 +515,51 @@ onChangeCheckbox=(e)=>{
...
@@ -563,50 +515,51 @@ onChangeCheckbox=(e)=>{
)
)
}
}
</Select> */
}
</Select> */
}
<
Input
placeholder
=
"请输入药物名称、Smiles"
style
=
{{
width
:
250
}}
size
=
"large"
onChange
=
{
this
.
getValue
}
value
=
{
this
.
state
.
searchData
.
drugs_data
}
/
>
<
Input
placeholder
=
'请输入药物名称、Smiles'
style
=
{{
width
:
250
}}
size
=
'large'
onChange
=
{
this
.
getValue
}
value
=
{
this
.
state
.
searchData
.
drugs_data
}
/
>
<
/Form.Item
>
<
/Form.Item
>
<
Form
.
Item
label
=
""
{...
formTailLayout
}
>
<
Form
.
Item
label
=
''
{...
formTailLayout
}
>
<
Button
type
=
"primary"
style
=
{{
marginRight
:
'50px'
}}
onClick
=
{
this
.
getDraw
}
>
画结构
<
/Button
>
<
Button
type
=
'primary'
style
=
{{
marginRight
:
'50px'
}}
onClick
=
{
this
.
getDraw
}
>
<
div
className
=
{
draw
?
'bottom-div'
:
'bottom-div isShowDiv'
}
onClick
=
{
this
.
getJsme
}
>
画结构
<
Jsme
height
=
"500px"
width
=
"700px"
options
=
"oldlook,star"
onChange
=
{
this
.
logSmiles
}
/
>
<
/Button
>
<
/div
>
<
div
className
=
{
draw
?
'bottom-div'
:
'bottom-div isShowDiv'
}
onClick
=
{
this
.
getJsme
}
>
<
/Form.Item
>
<
Jsme
height
=
'500px'
width
=
'700px'
options
=
'oldlook,star'
onChange
=
{
this
.
logSmiles
}
/
>
<
Form
.
Item
label
=
"通过PDB筛选药物"
{...
formItemLayout
}
>
<
/div
>
<
Radio
.
Group
onChange
=
{
this
.
onChangeRadio
}
value
=
{
this
.
state
.
searchData
.
pdb_status
}
>
<
/Form.Item
>
<
Radio
value
=
{
0
}
>
不筛选
<
/Radio
>
<
Form
.
Item
label
=
'通过PDB筛选药物'
{...
formItemLayout
}
>
<
Radio
value
=
{
2
}
>
筛选有
PDB
的药物
<
/Radio
>
<
Radio
.
Group
onChange
=
{
this
.
onChangeRadio
}
value
=
{
this
.
state
.
searchData
.
pdb_status
}
>
<
/Radio.Group
>
<
Radio
value
=
{
0
}
>
不筛选
<
/Radio
>
<
/Form.Item
>
<
Radio
value
=
{
2
}
>
筛选有
PDB
的药物
<
/Radio
>
<
Form
.
Item
label
=
"利用target查询化合物"
{...
formItemLayout
}
>
<
/Radio.Group
>
<
Input
placeholder
=
"请输入target name、uniprot id"
style
=
{{
width
:
250
}}
size
=
"large"
onChange
=
{
this
.
getTargetData
}
value
=
{
this
.
state
.
searchData
.
target_data
}
/
>
<
/Form.Item
>
<
Form
.
Item
label
=
'利用target查询化合物'
{...
formItemLayout
}
>
<
/Form.Item
>
<
Input
placeholder
=
'请输入target name、uniprot id'
style
=
{{
width
:
250
}}
size
=
'large'
onChange
=
{
this
.
getTargetData
}
value
=
{
this
.
state
.
searchData
.
target_data
}
/
>
<
Form
.
Item
label
=
"利用Indication查询药物"
{...
formItemLayout
}
>
<
/Form.Item
>
<
Input
placeholder
=
"请输入indication"
style
=
{{
width
:
250
}}
size
=
"large"
onChange
=
{
this
.
getindication
}
value
=
{
this
.
state
.
searchData
.
indication
}
/
>
<
Form
.
Item
label
=
'利用Indication查询药物'
{...
formItemLayout
}
>
<
Button
type
=
"primary"
style
=
{{
marginLeft
:
50
,
width
:
150
}}
size
=
'large'
loading
=
{
this
.
state
.
loading
}
onClick
=
{
this
.
getDrugsList
}
>
Search
<
/Button
>
<
Input
placeholder
=
'请输入indication'
style
=
{{
width
:
250
}}
size
=
'large'
onChange
=
{
this
.
getindication
}
value
=
{
this
.
state
.
searchData
.
indication
}
/
>
<
/Form.Item
>
<
Button
type
=
'primary'
style
=
{{
marginLeft
:
50
,
width
:
150
}}
size
=
'large'
loading
=
{
this
.
state
.
loading
}
onClick
=
{
this
.
getDrugsList
}
>
<
Form
.
Item
label
=
"Tips"
{...
formTailLayout2
}
>
Search
<
div
className
=
'Tips-div'
>
<
/Button
>
<
/Form.Item
>
<
Form
.
Item
label
=
'Tips'
{...
formTailLayout2
}
>
<
div
className
=
'Tips-div'
>
<
div
>
1
.
本页面提供包含上市药物和进入临床实验的药物相关数据检索功能。
<
/div
>
<
div
>
1
.
本页面提供包含上市药物和进入临床实验的药物相关数据检索功能。
<
/div
>
<
div
>
2
.
您可以直接检索药物名称,精准搜索您所需要的药物。您也可以试着画出您希望查询的分子片段,以检索包含这些片段的药物分子。
<
/div
>
<
div
>
2
.
您可以直接检索药物名称,精准搜索您所需要的药物。您也可以试着画出您希望查询的分子片段,以检索包含这些片段的药物分子。
<
/div
>
<
div
>
3
.
您也可以通过药物作用的靶点模糊搜索药物,选择您感兴趣的单个靶点或者一类靶点,查看相关药物分子。
<
/div
>
<
div
>
3
.
您也可以通过药物作用的靶点模糊搜索药物,选择您感兴趣的单个靶点或者一类靶点,查看相关药物分子。
<
/div
>
<
div
>
4
.
如果您对药物分子与蛋白结晶结构的作用感兴趣,也可以勾选“筛选有
PDB
的药物”选项,检索符合要求的药物分子。
<
/div
>
<
div
>
4
.
如果您对药物分子与蛋白结晶结构的作用感兴趣,也可以勾选“筛选有
PDB
的药物”选项,检索符合要求的药物分子。
<
/div
>
<
div
>
5
.
使用药物的适应症作为检索关键词,可以检索出与病症相关的药物分子。
<
/div
>
<
div
>
5
.
使用药物的适应症作为检索关键词,可以检索出与病症相关的药物分子。
<
/div
>
<
/div
>
<
/div
>
<
/Form.Item
>
<
/Form.Item
>
<
/Form
>
<
/Form
>
<
/div
>
<
/div
>
<
/div
>
<
/TabPane
>
<
/div
>
<
/TabPane
>
<
TabPane
tab
=
'Target'
key
=
'Target'
>
<
div
className
=
'top-div'
>
<
TabPane
tab
=
"Target"
key
=
"Target"
>
<
div
>
<
div
className
=
'top-div'
>
<
Form
layout
=
'horizontal'
>
<
div
>
<
Form
.
Item
label
=
'直接查询target'
{...
formItemLayout
}
>
<
Form
layout
=
"horizontal"
>
{
/* <Select value={this.state.TargetSearchData.target_type} style={{ width: 250 }} size="large" onChange={this.targetChange}>
<
Form
.
Item
label
=
"直接查询target"
{...
formItemLayout
}
>
{
/* <Select value={this.state.TargetSearchData.target_type} style={{ width: 250 }} size="large" onChange={this.targetChange}>
{
{
targetList.map(
targetList.map(
(item,index)=>{
(item,index)=>{
...
@@ -618,53 +571,49 @@ onChangeCheckbox=(e)=>{
...
@@ -618,53 +571,49 @@ onChangeCheckbox=(e)=>{
)
)
}
}
</Select> */
}
</Select> */
}
<
Input
placeholder
=
"请输入target name、uniprot id"
style
=
{{
width
:
250
}}
size
=
"large"
onChange
=
{
this
.
getTargetData2
}
value
=
{
this
.
state
.
TargetSearchData
.
target_data
}
/
>
<
Input
placeholder
=
'请输入target name、uniprot id'
style
=
{{
width
:
250
}}
size
=
'large'
onChange
=
{
this
.
getTargetData2
}
value
=
{
this
.
state
.
TargetSearchData
.
target_data
}
/
>
<
/Form.Item
>
<
/Form.Item
>
<
Form
.
Item
label
=
"通过PDB筛选target"
{...
formItemLayout
}
>
<
Form
.
Item
label
=
'通过PDB筛选target'
{...
formItemLayout
}
>
<
Radio
.
Group
onChange
=
{
this
.
onChangeRadio2
}
value
=
{
this
.
state
.
TargetSearchData
.
pdb_status
}
>
<
Radio
.
Group
onChange
=
{
this
.
onChangeRadio2
}
value
=
{
this
.
state
.
TargetSearchData
.
pdb_status
}
>
<
Radio
value
=
{
0
}
>
不筛选
<
/Radio
>
<
Radio
value
=
{
0
}
>
不筛选
<
/Radio
>
<
Radio
value
=
{
2
}
>
筛选有
PDB
的
target
<
/Radio
>
<
Radio
value
=
{
2
}
>
筛选有
PDB
的
target
<
/Radio
>
<
/Radio.Group
>
<
/Radio.Group
>
<
/Form.Item
>
<
/Form.Item
>
<
Form
.
Item
label
=
""
{...
formTailLayout2
}
>
<
Form
.
Item
label
=
''
{...
formTailLayout2
}
>
<
Button
type
=
'primary'
style
=
{{
marginLeft
:
50
,
width
:
150
}}
size
=
'large'
loading
=
{
this
.
state
.
loading
}
onClick
=
{
this
.
getTargetList
}
>
<
Button
type
=
"primary"
style
=
{{
marginLeft
:
50
,
width
:
150
}}
size
=
'large'
loading
=
{
this
.
state
.
loading
}
onClick
=
{
this
.
getTargetList
}
>
Search
<
/Button
>
Search
<
/Form.Item
>
<
/Button
>
<
Form
.
Item
label
=
"Tips"
{...
formTailLayout2
}
>
<
/Form.Item
>
<
Form
.
Item
label
=
'Tips'
{...
formTailLayout2
}
>
<
div
className
=
'Tips-div'
>
<
div
className
=
'Tips-div'
>
<
div
>
1
.
本页面提供有药物关系的靶点数据检索功能。
<
/div
>
<
div
>
1
.
本页面提供有药物关系的靶点数据检索功能。
<
/div
>
<
div
>
2
.
您可以直接检索靶点
Uniprot
名称或者
ID
,精准搜索您所需要的靶点。
<
/div
>
<
div
>
2
.
您可以直接检索靶点
Uniprot
名称或者
ID
,精准搜索您所需要的靶点。
<
/div
>
<
div
>
3
.
如果您对靶点的结晶结构感兴趣,也可以勾选“筛选有
PDB
的
target
”选项,检索有结晶结构的靶点。
<
/div
>
<
div
>
3
.
如果您对靶点的结晶结构感兴趣,也可以勾选“筛选有
PDB
的
target
”选项,检索有结晶结构的靶点。
<
/div
>
<
/div
>
<
/div
>
<
/Form.Item
>
<
/Form.Item
>
<
/Form
>
<
/Form
>
<
/div
>
<
/div
>
<
/div
>
<
/TabPane
>
<
TabPane
tab
=
'Indication'
key
=
'Indication'
>
<
/div
>
<
div
className
=
'top-div'
>
<
/TabPane
>
<
div
>
<
TabPane
tab
=
"Indication"
key
=
"Indication"
>
<
Form
layout
=
'horizontal'
>
<
div
className
=
'top-div'
>
<
Form
.
Item
label
=
'输入适应症进行检索'
{...
formItemLayout
}
>
<
div
>
<
Input
placeholder
=
'请输入适应症'
style
=
{{
width
:
250
}}
size
=
'large'
onChange
=
{
this
.
getIndicationValue
}
value
=
{
this
.
state
.
IndicationSearchData
.
indication
}
/
>
<
Form
layout
=
"horizontal"
>
<
Button
type
=
'primary'
style
=
{{
marginLeft
:
50
,
width
:
150
}}
size
=
'large'
loading
=
{
this
.
state
.
loading
}
onClick
=
{
this
.
getIndicationList
}
>
<
Form
.
Item
label
=
"输入适应症进行检索"
{...
formItemLayout
}
>
Search
<
Input
placeholder
=
"请输入适应症"
style
=
{{
width
:
250
}}
size
=
"large"
onChange
=
{
this
.
getIndicationValue
}
value
=
{
this
.
state
.
IndicationSearchData
.
indication
}
/
>
<
/Button
>
<
Button
type
=
"primary"
style
=
{{
marginLeft
:
50
,
width
:
150
}}
size
=
'large'
loading
=
{
this
.
state
.
loading
}
onClick
=
{
this
.
getIndicationList
}
>
Search
<
/Button
>
<
/Form.Item
>
<
/Form.Item
>
<
/Form
>
<
/div
>
<
/Form
>
<
/div
>
<
/TabPane
>
<
/div
>
<
/Tabs
>
<
/div>
<
/TabPane
>
<
/Tabs
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
)
;
}
}
}
}
export
default
Home
export
default
Home
;
\ No newline at end of file
src/utils/request.js
View file @
72f1dc61
...
@@ -17,13 +17,54 @@ function disableF12() {
...
@@ -17,13 +17,54 @@ function disableF12() {
}
}
// disableF12();
// disableF12();
//对axios二次封装
const
token
=
getQueryString
(
'token'
);
function
checkFetchToken
()
{
fetch
(
'http://69.235.144.91:8048/yszh-login/auth/checkToken'
,
{
method
:
'GET'
,
headers
:
{
accessToken
:
token
,
},
})
.
then
((
res
)
=>
res
.
json
())
.
then
((
res
)
=>
{
console
.
log
(
'fetch--res'
,
res
);
if
(
res
.
code
===
200
)
{
//校验通过,存储token
token
&&
localStorage
.
setItem
(
'token'
,
token
);
}
else
{
alert
(
'token校验失败,返回登录页'
);
// window.open('http://localhost:3000/#/login', '_self');
window
.
open
(
'http://69.235.144.91:3048/#/login'
,
'_self'
);
}
})
.
catch
(
function
(
err
)
{
console
.
log
(
'err'
,
err
);
window
.
open
(
'http://69.235.144.91:3048/#/login'
,
'_self'
);
});
// request
// .get('http://69.235.144.91:8048/yszh-login/auth/checkToken')
// .then((res) => {
// console.log('--res', res);
// if (res.data.code === 200) {
// console.log('token 检验通过');
// return config;
// } else {
// console.log('token校验没通过 返回登录页');
// window.open('http://69.235.144.91:3048/#/login', '_self');
// }
// })
// .catch((err) => {
// console.log('token校验没通过 返回登录页');
// window.open('http://69.235.144.91:3048/#/login', '_self');
// console.log('err', err);
// });
}
checkFetchToken
();
const
baseURL
=
'http://52.83.169.190:8002/'
;
//线上正式环境
const
baseURL
=
'http://52.83.169.190:8002/'
;
//线上正式环境
// const baseURL = 'http://69.235.144.91:8002/'; 测试环境
// const baseURL = 'http://69.235.144.91:8002/'; 测试环境
//对axios二次封装
// console.log('getQueryString', getQueryString('token'));
// console.log('localStorage', localStorage.getItem('token'));
const
token
=
getQueryString
(
'token'
)
||
localStorage
.
getItem
(
'token'
);
const
request
=
axios
.
create
({
const
request
=
axios
.
create
({
baseURL
,
baseURL
,
timeout
:
15000
,
timeout
:
15000
,
...
@@ -34,44 +75,16 @@ const request = axios.create({
...
@@ -34,44 +75,16 @@ const request = axios.create({
},
},
});
});
function
checkToken
(
config
)
{
// alert(' 校验token111');
request
.
get
(
'http://69.235.144.91:8048/yszh-login/auth/checkToken'
)
.
then
((
res
)
=>
{
console
.
log
(
'--res'
,
res
);
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
'token 检验通过'
);
return
config
;
}
else
{
localStorage
.
removeItem
(
'token'
);
// alert(' 失败');
console
.
log
(
'token校验没通过 返回登录页'
);
// window.open('http://localhost:3000/#/login', '_self');
window
.
open
(
'http://69.235.144.91:3048/#/login'
,
'_self'
);
}
})
.
catch
((
err
)
=>
{
localStorage
.
removeItem
(
'token'
);
// alert(' 服务器报错');
console
.
log
(
'token校验没通过 返回登录页'
);
window
.
open
(
'http://69.235.144.91:3048/#/login'
,
'_self'
);
console
.
log
(
'err'
,
err
);
return
false
;
});
}
checkToken
();
//拦截器
//拦截器
request
.
interceptors
.
request
.
use
((
config
)
=>
{
request
.
interceptors
.
request
.
use
((
config
)
=>
{
// alert('拦截器..');
// alert('拦截器..');
console
.
log
(
'token---'
,
'拦截器方法校验token'
);
console
.
log
(
'token---'
,
'拦截器方法校验token'
);
console
.
log
(
config
);
console
.
log
(
config
);
if
(
getQueryString
(
'token'
)
||
localStorage
.
getItem
(
'token'
))
{
if
(
localStorage
.
getItem
(
'token'
))
{
checkToken
(
config
);
config
.
headers
[
'accessToken'
]
=
localStorage
.
getItem
(
'token'
);
return
config
;
}
else
{
}
else
{
console
.
log
(
'token为空....'
);
console
.
log
(
'token为空....'
);
localStorage
.
removeItem
(
'token'
);
window
.
open
(
'http://69.235.144.91:3048/#/login'
,
'_self'
);
window
.
open
(
'http://69.235.144.91:3048/#/login'
,
'_self'
);
}
}
});
});
...
...
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