Commit 3ab38e45 authored by lihaihan's avatar lihaihan

test

parent b77616fa
......@@ -6,7 +6,7 @@
"author": "GuoMingyao",
"private": true,
"scripts": {
"dev": "vite",
"dev": "vue-tsc --noEmit && vite",
"start": "npm run dev",
"build": "vue-tsc --noEmit && vite build --mode production",
"build:sit": "vue-tsc --noEmit && vite build --mode sit",
......
......@@ -17,16 +17,25 @@ function getToken() {
return header ? header.authorization : tokenIns.get()
}
let header = tokenIns.getHeaders()
let header = window.__DM_GLOBE_UTIL ? window.__DM_GLOBE_UTIL.getHeader() : null;
switch (process.env.NODE_ENV) {
case 'production':
BASE_URL = 'https://www.maicedata.com/collector/data/' // 生产环境
if (header) {
//新版的取值方式
TOKEN = header['Authorization']
mdtUser = header['Mdt-User']
imperToken = header['X-Impersonate-Token']
TOKEN = header['authorization'];
mdtUser = header['mdt-user'];
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()
MAP_CONFIG = {
jsApiUrl: 'http://10.108.3.48/api418/arcgis_js_api/library/4.18/init.js',
......@@ -38,10 +47,19 @@ switch (process.env.NODE_ENV) {
BASE_URL = 'https://survey.maicedata.com/api/data/' // 测试环境(暂时部署在测绘院用)
// TOKEN = '91e315a9-b2a8-4950-97fa-9dbf84a230d6'
if (header) {
//新版的取值方式
TOKEN = header['Authorization']
mdtUser = header['Mdt-User']
imperToken = header['X-Impersonate-Token']
TOKEN = header['authorization'];
mdtUser = header['mdt-user'];
imperToken = header['x-impersonate-token'];
imperMdtUser = header['x-impersonate-user'];
} else {
//旧版的取值方式
TOKEN = tokenIns.get();
mdtUser = tokenIns.getMdtUser();
imperToken = tokenIns.getImperToken();
imperMdtUser = tokenIns.getImperMdtUser();
}
MAP_CONFIG = {
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',
......@@ -51,10 +69,19 @@ switch (process.env.NODE_ENV) {
BASE_URL = '/api' // vite.config 代理 https://survey.maicedata.com/api/data/
// TOKEN = '91e315a9-b2a8-4950-97fa-9dbf84a230d6'
if (header) {
//新版的取值方式
TOKEN = header['Authorization']
mdtUser = header['Mdt-User']
imperToken = header['X-Impersonate-Token']
TOKEN = header['authorization'];
mdtUser = header['mdt-user'];
imperToken = header['x-impersonate-token'];
imperMdtUser = header['x-impersonate-user'];
} else {
//旧版的取值方式
TOKEN = tokenIns.get();
mdtUser = tokenIns.getMdtUser();
imperToken = tokenIns.getImperToken();
imperMdtUser = tokenIns.getImperMdtUser();
}
MAP_CONFIG = {
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',
......
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