Commit f88f1b66 authored by liushanzhuang's avatar liushanzhuang

修改问题

parent e1b6a92b
......@@ -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/api418/arcgis_js_api/library/4.18/init.js',
cssUrl: 'https://hm.metrodata.cn/cehuiyuan/api418/arcgis_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/api418/arcgis_js_api/library/4.18/init.js',
cssUrl: 'https://hm.metrodata.cn/cehuiyuan/api418/arcgis_js_api/library/4.18/esri/css/main.css',
}
}
const TOKEN = tokenIns.get()
console.log(TOKEN, "ass")
export default {
TOKEN,
mdtUser,
......
......@@ -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',
'https://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',
'https://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: 'https://hm.metrodata.cn/cehuiyuan/changsanjiao/rest/services/Hosted/HM_BUILDING0826/SceneServer',
visible: true,
title: '精模',
id: 'jingmo',
......
......@@ -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
}
......
......@@ -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 = `https://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=*`,
`https://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
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment