Commit b77616fa authored by lihaihan's avatar lihaihan

test

parent 6fd59784
...@@ -17,25 +17,16 @@ function getToken() { ...@@ -17,25 +17,16 @@ function getToken() {
return header ? header.authorization : tokenIns.get() return header ? header.authorization : tokenIns.get()
} }
let header = tokenIns.getHeaders()
switch (process.env.NODE_ENV) { 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/' // 生产环境
let header = window.__DM_GLOBE_UTIL ? window.__DM_GLOBE_UTIL.getHeader() : null
if (header) {
//新版的取值方式 //新版的取值方式
TOKEN = header['authorization'] TOKEN = header['Authorization']
mdtUser = header['mdt-user'] mdtUser = header['Mdt-User']
imperToken = header['x-impersonate-token'] imperToken = header['X-Impersonate-Token']
imperMdtUser = header['x-impersonate-user']
} else {
//旧版的取值方式
TOKEN = tokenIns.get()
mdtUser = tokenIns.getMdtUser()
imperToken = tokenIns.getImperToken()
imperMdtUser = tokenIns.getImperMdtUser()
}
// TOKEN = getToken() // TOKEN = getToken()
MAP_CONFIG = { MAP_CONFIG = {
jsApiUrl: 'http://10.108.3.48/api418/arcgis_js_api/library/4.18/init.js', jsApiUrl: 'http://10.108.3.48/api418/arcgis_js_api/library/4.18/init.js',
...@@ -45,7 +36,12 @@ switch (process.env.NODE_ENV) { ...@@ -45,7 +36,12 @@ switch (process.env.NODE_ENV) {
break break
case 'sit': case 'sit':
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'
//新版的取值方式
TOKEN = header['Authorization']
mdtUser = header['Mdt-User']
imperToken = header['X-Impersonate-Token']
MAP_CONFIG = { MAP_CONFIG = {
jsApiUrl: 'http://10.108.3.41/arcgis_js_api/library/4.18/init.js', jsApiUrl: 'http://10.108.3.41/arcgis_js_api/library/4.18/init.js',
cssUrl: 'http://10.108.3.41/arcgis_js_api/library/4.18/esri/css/main.css', cssUrl: 'http://10.108.3.41/arcgis_js_api/library/4.18/esri/css/main.css',
...@@ -53,7 +49,12 @@ switch (process.env.NODE_ENV) { ...@@ -53,7 +49,12 @@ switch (process.env.NODE_ENV) {
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'
//新版的取值方式
TOKEN = header['Authorization']
mdtUser = header['Mdt-User']
imperToken = header['X-Impersonate-Token']
MAP_CONFIG = { MAP_CONFIG = {
jsApiUrl: 'http://10.108.3.41/arcgis_js_api/library/4.18/init.js', jsApiUrl: 'http://10.108.3.41/arcgis_js_api/library/4.18/init.js',
cssUrl: 'http://10.108.3.41/arcgis_js_api/library/4.18/esri/css/main.css', cssUrl: 'http://10.108.3.41/arcgis_js_api/library/4.18/esri/css/main.css',
...@@ -64,7 +65,6 @@ export default { ...@@ -64,7 +65,6 @@ export default {
TOKEN, TOKEN,
mdtUser, mdtUser,
imperToken, imperToken,
imperMdtUser,
BASE_URL, BASE_URL,
MAP_CONFIG, MAP_CONFIG,
ORGANIZATION: '733d0ac0-f67e-4bde-8872-3ca00983f18c', ORGANIZATION: '733d0ac0-f67e-4bde-8872-3ca00983f18c',
......
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