Commit f88f1b66 authored by liushanzhuang's avatar liushanzhuang

修改问题

parent e1b6a92b
...@@ -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__')
...@@ -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/api418/arcgis_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/api418/arcgis_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/api418/arcgis_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/api418/arcgis_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,
......
...@@ -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', 'https://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', 'https://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: 'https://hm.metrodata.cn/cehuiyuan/changsanjiao/rest/services/Hosted/HM_BUILDING0826/SceneServer',
visible: true, visible: true,
title: '精模', title: '精模',
id: 'jingmo', id: 'jingmo',
......
...@@ -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
} }
......
...@@ -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 = `https://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=*`, `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 )?.data?.features?.[0]?.attributes?.id || null
if (!objectId) return if (!objectId) return
......
This diff is collapsed.
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