Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
68952f56
Commit
68952f56
authored
Mar 31, 2022
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: AMAP 多版本SDK兼容
parent
46237ddf
Pipeline
#47008
skipped with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
32 deletions
+7
-32
index.js
src/api/index.js
+1
-11
index.js
src/pages/map/index.js
+6
-21
No files found.
src/api/index.js
View file @
68952f56
...
...
@@ -47,17 +47,7 @@ instanceRequest.setErrorHandler(error => {
const
errorText
=
codeMessage
[
response
.
status
]
||
response
.
statusText
;
const
{
status
,
config
}
=
response
;
if
(
status
===
401
)
{
if
(
!
instance
)
{
instance
=
warning
({
title
:
'错误信息'
,
content
:
`
${
codeMessage
[
status
]}
`
,
centered
:
true
,
onOk
(
close
)
{
event
.
emit
(
'event:logout'
);
close
();
},
});
}
event
.
emit
(
'event:logout'
);
}
else
{
// notification.error({
// message: `请求错误 ${status}: ${config.url}`,
...
...
src/pages/map/index.js
View file @
68952f56
...
...
@@ -3,36 +3,21 @@ import _ from 'lodash'
import
{
connect
}
from
'react-redux'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
MapComponent
from
'@/components/mapView'
;
import
AMapLoader
from
'@amap/amap-jsapi-loader'
;
class
CreateMap
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
mapManganerRef
=
React
.
createRef
();
[
'_AMap_vectorlayer'
,
'_AMap_AMap.MouseTool'
,
'_AMap_AMap.DistrictSearch'
,
'_AMap_AMap.Autocomplete'
,
'_AMap_sync'
,
'_AMap_AMap.PlaceSearch'
,
'_AMap_wgl'
,
'_AMap_overlay'
,
'_AMap_mouse'
].
forEach
(
item
=>
{
localStorage
.
removeItem
(
item
)
});
AMapLoader
.
reset
();
}
// state = {
// loading: true,
// config: this.props.global.mapsettings,
// widgets: this.props.global.uiwidgets,
// };
// componentWillReceiveProps(nextProps) {
// if(nextProps.global.mapsettings !== this.props.global.mapsettings) {
// this.setState(Object.assign({}, this.state, {
// config: nextProps.global.mapsettings
// }))
// }
// if(nextProps.global.uiwidgets !== this.props.global.uiwidgets) {
// this.setState(Object.assign({}, this.state, {
// widgets: nextProps.global.uiwidgets
// }))
// }
// }
getView
=
view
=>
{
console
.
log
(
view
)
this
.
props
.
updageMapView
(
view
);
};
...
...
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