Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
huamu
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
郭铭瑶
huamu
Commits
f88f1b66
Commit
f88f1b66
authored
Sep 24, 2021
by
liushanzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改问题
parent
e1b6a92b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4945 additions
and
22 deletions
+4945
-22
api.ts
src/ajax/api.ts
+10
-6
useInitMap.ts
src/hooks/useInitMap.ts
+11
-11
tokenUtil.ts
src/util/tokenUtil.ts
+3
-3
map.vue
src/view/components/map.vue
+2
-2
yarn.lock
yarn.lock
+4919
-0
No files found.
src/ajax/api.ts
View file @
f88f1b66
...
...
@@ -6,7 +6,8 @@ let MAP_CONFIG: { jsApiUrl: string; cssUrl: string } = {
cssUrl
:
''
,
}
const
TOKEN
=
getCookie
(
'__DM_TOKEN__'
)
// const TOKEN = getCookie('__DM_TOKEN__')
const
mdtUser
=
getCookie
(
'__DM_MDT_USER__'
)
const
imperToken
=
getCookie
(
'__DM_IMPER_TOKEN__'
)
const
imperMdtUser
=
getCookie
(
'__DM_IMPER_MDT_USER__'
)
...
...
@@ -26,19 +27,22 @@ switch (process.env.NODE_ENV) {
BASE_URL
=
'https://survey.maicedata.com/api/data/'
// 测试环境(暂时部署在测绘院用)
// TOKEN = '91e315a9-b2a8-4950-97fa-9dbf84a230d6'
MAP_CONFIG
=
{
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/arcgis_js_api/library/4.18/init.js'
,
cssUrl
:
'https://hm.metrodata.cn/cehuiyuan/arcgis_js_api/library/4.18/esri/css/main.css'
,
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/a
pi418/a
rcgis_js_api/library/4.18/init.js'
,
cssUrl
:
'https://hm.metrodata.cn/cehuiyuan/a
pi418/a
rcgis_js_api/library/4.18/esri/css/main.css'
,
}
break
default
:
BASE_URL
=
'/api'
// vite.config 代理 https://survey.maicedata.com/api/data/
// TOKEN = '91e315a9-b2a8-4950-97fa-9dbf84a230d6'
MAP_CONFIG
=
{
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/arcgis_js_api/library/4.18/init.js'
,
cssUrl
:
'https://hm.metrodata.cn/cehuiyuan/arcgis_js_api/library/4.18/esri/css/main.css'
,
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/a
pi418/a
rcgis_js_api/library/4.18/init.js'
,
cssUrl
:
'https://hm.metrodata.cn/cehuiyuan/a
pi418/a
rcgis_js_api/library/4.18/esri/css/main.css'
,
}
}
const
TOKEN
=
tokenIns
.
get
()
console
.
log
(
TOKEN
,
"ass"
)
export
default
{
TOKEN
,
mdtUser
,
...
...
src/hooks/useInitMap.ts
View file @
f88f1b66
...
...
@@ -78,10 +78,10 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
* 在请求发出去之前,把请求中的机器名改成ip
* */
before
:
function
(
params
:
any
)
{
params
.
url
=
params
.
url
.
replace
(
'https://changsanjiao.shsmi.com'
,
'http://10.108.3.48'
,
)
//
params.url = params.url.replace(
//
'https://changsanjiao.shsmi.com',
//
'http://10.108.3.48',
//
)
},
})
esriConfig
.
request
.
interceptors
.
push
({
...
...
@@ -91,10 +91,10 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
* 在请求发出去之前,把请求中的机器名改成ip
* */
before
:
function
(
params
:
any
)
{
params
.
url
=
params
.
url
.
replace
(
'http://changsanjiao.shsmi.com'
,
'http://10.108.3.48'
,
)
//
params.url = params.url.replace(
//
'http://changsanjiao.shsmi.com',
//
'http://10.108.3.48',
//
)
},
})
...
...
@@ -134,7 +134,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
])
const
baseLayer
=
new
TileLayer
(
'http
://10.108.3.48
/changsanjiao/rest/services/Hosted/Base_Map/MapServer'
,
'http
s://hm.metrodata.cn/cehuiyuan
/changsanjiao/rest/services/Hosted/Base_Map/MapServer'
,
{
id
:
'zhengwuBasemap'
,
visible
:
true
,
...
...
@@ -144,7 +144,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
)
const
sjgyLayer
=
new
TileLayer
(
'http
://10.108.3.48
/changsanjiao/rest/services/sjgy_3857/MapServer'
,
'http
s://hm.metrodata.cn/cehuiyuan
/changsanjiao/rest/services/sjgy_3857/MapServer'
,
{
id
:
'sjgy'
,
visible
:
true
,
...
...
@@ -164,7 +164,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
map
.
layers
.
add
(
baseMapGroupLayer
)
const
sceneLayer0
=
new
SceneLayer
({
url
:
'http
://10.108.3.48
/changsanjiao/rest/services/Hosted/HM_BUILDING0826/SceneServer'
,
url
:
'http
s://hm.metrodata.cn/cehuiyuan
/changsanjiao/rest/services/Hosted/HM_BUILDING0826/SceneServer'
,
visible
:
true
,
title
:
'精模'
,
id
:
'jingmo'
,
...
...
src/util/tokenUtil.ts
View file @
f88f1b66
...
...
@@ -35,14 +35,14 @@ const DM_IMPER_MDT_USER = '__DM_IMPER_MDT_USER__' // 当前模拟操作用户mdt
const
parseFromCookie
=
(
key
:
string
)
=>
{
let
cookieToken
=
getCookie
(
key
)
console
.
log
(
cookieToken
)
if
(
!
cookieToken
||
cookieToken
.
length
!==
47
)
{
if
(
!
cookieToken
)
{
cookieToken
=
localStorage
.
getItem
(
'dm_token_'
)
console
.
log
(
cookieToken
)
}
const
p12Asn1
=
cookieToken
?
LZString
.
decompressFromEncodedURIComponent
(
cookieToken
)
:
''
console
.
log
(
p12Asn1
)
return
p12Asn1
}
...
...
src/view/components/map.vue
View file @
f88f1b66
...
...
@@ -131,7 +131,7 @@ async function queryBound(layerId: number, name: string) {
'esri/layers/GraphicsLayer'
,
])
const
jdLayerUrl
=
`http
://10.108.3.48
/changsanjiao/rest/services/HM_BOUND_3857/MapServer/
${
layerId
}
`
const
jdLayerUrl
=
`http
s://hm.metrodata.cn/cehuiyuan
/changsanjiao/rest/services/HM_BOUND_3857/MapServer/
${
layerId
}
`
const
queryTask
=
new
QueryTask
({
url
:
jdLayerUrl
,
})
...
...
@@ -186,7 +186,7 @@ function showBuilding(name: string) {
const
objectId
=
(
await
axios
.
get
(
`http
://10.108.3.48
/changsanjiao/rest/services/HM_BOUND_3857/MapServer/4/query?where=NAME=%27
${
name
}
%27&f=json&outFields=*`
,
`http
s://hm.metrodata.cn/cehuiyuan
/changsanjiao/rest/services/HM_BOUND_3857/MapServer/4/query?where=NAME=%27
${
name
}
%27&f=json&outFields=*`
,
)
)?.
data
?.
features
?.[
0
]?.
attributes
?.
id
||
null
if
(
!
objectId
)
return
...
...
yarn.lock
0 → 100644
View file @
f88f1b66
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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