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
Expand all
Hide 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 } = {
...
@@ -6,7 +6,8 @@ let MAP_CONFIG: { jsApiUrl: string; cssUrl: string } = {
cssUrl
:
''
,
cssUrl
:
''
,
}
}
const
TOKEN
=
getCookie
(
'__DM_TOKEN__'
)
// const TOKEN = getCookie('__DM_TOKEN__')
const
mdtUser
=
getCookie
(
'__DM_MDT_USER__'
)
const
mdtUser
=
getCookie
(
'__DM_MDT_USER__'
)
const
imperToken
=
getCookie
(
'__DM_IMPER_TOKEN__'
)
const
imperToken
=
getCookie
(
'__DM_IMPER_TOKEN__'
)
const
imperMdtUser
=
getCookie
(
'__DM_IMPER_MDT_USER__'
)
const
imperMdtUser
=
getCookie
(
'__DM_IMPER_MDT_USER__'
)
...
@@ -15,7 +16,7 @@ switch (process.env.NODE_ENV) {
...
@@ -15,7 +16,7 @@ switch (process.env.NODE_ENV) {
case
'production'
:
case
'production'
:
BASE_URL
=
'https://www.maicedata.com/collector/data/'
// 生产环境
BASE_URL
=
'https://www.maicedata.com/collector/data/'
// 生产环境
//
TOKEN = getToken()
// TOKEN = getToken()
MAP_CONFIG
=
{
MAP_CONFIG
=
{
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/api418/arcgis_js_api/library/4.18/init.js'
,
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/api418/arcgis_js_api/library/4.18/init.js'
,
cssUrl
:
cssUrl
:
...
@@ -26,19 +27,22 @@ switch (process.env.NODE_ENV) {
...
@@ -26,19 +27,22 @@ switch (process.env.NODE_ENV) {
BASE_URL
=
'https://survey.maicedata.com/api/data/'
// 测试环境(暂时部署在测绘院用)
BASE_URL
=
'https://survey.maicedata.com/api/data/'
// 测试环境(暂时部署在测绘院用)
// TOKEN = '91e315a9-b2a8-4950-97fa-9dbf84a230d6'
// TOKEN = '91e315a9-b2a8-4950-97fa-9dbf84a230d6'
MAP_CONFIG
=
{
MAP_CONFIG
=
{
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/arcgis_js_api/library/4.18/init.js'
,
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/a
pi418/a
rcgis_js_api/library/4.18/init.js'
,
cssUrl
:
'https://hm.metrodata.cn/cehuiyuan/arcgis_js_api/library/4.18/esri/css/main.css'
,
cssUrl
:
'https://hm.metrodata.cn/cehuiyuan/a
pi418/a
rcgis_js_api/library/4.18/esri/css/main.css'
,
}
}
break
break
default
:
default
:
BASE_URL
=
'/api'
// vite.config 代理 https://survey.maicedata.com/api/data/
BASE_URL
=
'/api'
// vite.config 代理 https://survey.maicedata.com/api/data/
// TOKEN = '91e315a9-b2a8-4950-97fa-9dbf84a230d6'
// TOKEN = '91e315a9-b2a8-4950-97fa-9dbf84a230d6'
MAP_CONFIG
=
{
MAP_CONFIG
=
{
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/arcgis_js_api/library/4.18/init.js'
,
jsApiUrl
:
'https://hm.metrodata.cn/cehuiyuan/a
pi418/a
rcgis_js_api/library/4.18/init.js'
,
cssUrl
:
'https://hm.metrodata.cn/cehuiyuan/arcgis_js_api/library/4.18/esri/css/main.css'
,
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
{
export
default
{
TOKEN
,
TOKEN
,
mdtUser
,
mdtUser
,
...
...
src/hooks/useInitMap.ts
View file @
f88f1b66
...
@@ -78,10 +78,10 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
...
@@ -78,10 +78,10 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
* 在请求发出去之前,把请求中的机器名改成ip
* 在请求发出去之前,把请求中的机器名改成ip
* */
* */
before
:
function
(
params
:
any
)
{
before
:
function
(
params
:
any
)
{
params
.
url
=
params
.
url
.
replace
(
//
params.url = params.url.replace(
'https://changsanjiao.shsmi.com'
,
//
'https://changsanjiao.shsmi.com',
'http://10.108.3.48'
,
//
'http://10.108.3.48',
)
//
)
},
},
})
})
esriConfig
.
request
.
interceptors
.
push
({
esriConfig
.
request
.
interceptors
.
push
({
...
@@ -91,10 +91,10 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
...
@@ -91,10 +91,10 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
* 在请求发出去之前,把请求中的机器名改成ip
* 在请求发出去之前,把请求中的机器名改成ip
* */
* */
before
:
function
(
params
:
any
)
{
before
:
function
(
params
:
any
)
{
params
.
url
=
params
.
url
.
replace
(
//
params.url = params.url.replace(
'http://changsanjiao.shsmi.com'
,
//
'http://changsanjiao.shsmi.com',
'http://10.108.3.48'
,
//
'http://10.108.3.48',
)
//
)
},
},
})
})
...
@@ -134,7 +134,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
...
@@ -134,7 +134,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
])
])
const
baseLayer
=
new
TileLayer
(
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'
,
id
:
'zhengwuBasemap'
,
visible
:
true
,
visible
:
true
,
...
@@ -144,7 +144,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
...
@@ -144,7 +144,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
)
)
const
sjgyLayer
=
new
TileLayer
(
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'
,
id
:
'sjgy'
,
visible
:
true
,
visible
:
true
,
...
@@ -164,7 +164,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
...
@@ -164,7 +164,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
map
.
layers
.
add
(
baseMapGroupLayer
)
map
.
layers
.
add
(
baseMapGroupLayer
)
const
sceneLayer0
=
new
SceneLayer
({
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
,
visible
:
true
,
title
:
'精模'
,
title
:
'精模'
,
id
:
'jingmo'
,
id
:
'jingmo'
,
...
...
src/util/tokenUtil.ts
View file @
f88f1b66
...
@@ -35,14 +35,14 @@ const DM_IMPER_MDT_USER = '__DM_IMPER_MDT_USER__' // 当前模拟操作用户mdt
...
@@ -35,14 +35,14 @@ const DM_IMPER_MDT_USER = '__DM_IMPER_MDT_USER__' // 当前模拟操作用户mdt
const
parseFromCookie
=
(
key
:
string
)
=>
{
const
parseFromCookie
=
(
key
:
string
)
=>
{
let
cookieToken
=
getCookie
(
key
)
let
cookieToken
=
getCookie
(
key
)
console
.
log
(
cookieToken
)
if
(
!
cookieToken
||
cookieToken
.
length
!==
47
)
{
if
(
!
cookieToken
)
{
cookieToken
=
localStorage
.
getItem
(
'dm_token_'
)
cookieToken
=
localStorage
.
getItem
(
'dm_token_'
)
console
.
log
(
cookieToken
)
}
}
const
p12Asn1
=
cookieToken
const
p12Asn1
=
cookieToken
?
LZString
.
decompressFromEncodedURIComponent
(
cookieToken
)
?
LZString
.
decompressFromEncodedURIComponent
(
cookieToken
)
:
''
:
''
console
.
log
(
p12Asn1
)
return
p12Asn1
return
p12Asn1
}
}
...
...
src/view/components/map.vue
View file @
f88f1b66
...
@@ -131,7 +131,7 @@ async function queryBound(layerId: number, name: string) {
...
@@ -131,7 +131,7 @@ async function queryBound(layerId: number, name: string) {
'esri/layers/GraphicsLayer'
,
'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
({
const
queryTask
=
new
QueryTask
({
url
:
jdLayerUrl
,
url
:
jdLayerUrl
,
})
})
...
@@ -186,7 +186,7 @@ function showBuilding(name: string) {
...
@@ -186,7 +186,7 @@ function showBuilding(name: string) {
const
objectId
=
const
objectId
=
(
(
await
axios
.
get
(
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
)?.
data
?.
features
?.[
0
]?.
attributes
?.
id
||
null
if
(
!
objectId
)
return
if
(
!
objectId
)
return
...
...
yarn.lock
0 → 100644
View file @
f88f1b66
This diff is collapsed.
Click to expand it.
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