|
|
@ -1,42 +1,104 @@ |
|
|
|
import 'babel-polyfill' |
|
|
|
import Vue from 'vue' |
|
|
|
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
|
|
|
|
|
|
|
|
import ElementUI from 'element-ui' |
|
|
|
import 'element-ui/lib/theme-chalk/index.css' |
|
|
|
Vue.use(ElementUI) |
|
|
|
|
|
|
|
import '@/styles/index.scss' // global css
|
|
|
|
|
|
|
|
import App from './App' |
|
|
|
import store from './store' |
|
|
|
import router from './router' |
|
|
|
|
|
|
|
import '@/icons' // icon
|
|
|
|
// 全局自定义组件
|
|
|
|
import Pagination from '@/components/pagination/index.vue' |
|
|
|
import tabsearch from '@/components/tab-search/index.vue' |
|
|
|
import eimage from '@/components/E-image/index.vue' |
|
|
|
import Print from '@/utils/print' // 引入附件的js文件
|
|
|
|
import { setStorage, setDefaultOrgPathName, setDefaultOrgPath } from './utils/auth.js' |
|
|
|
import VueAMap from 'vue-amap' |
|
|
|
import request from '@/utils/request' |
|
|
|
|
|
|
|
Vue.use(ElementUI) |
|
|
|
|
|
|
|
// import '@/permission' //权限控制
|
|
|
|
|
|
|
|
Vue.prototype.$userInfo = null // 用户信息
|
|
|
|
// 全局自定义组件
|
|
|
|
import Pagination from '@/components/pagination/index.vue' |
|
|
|
|
|
|
|
Vue.component('Pagination', Pagination) |
|
|
|
import tabsearch from '@/components/tab-search/index.vue' |
|
|
|
|
|
|
|
Vue.component('tab-search', tabsearch) |
|
|
|
import eimage from '@/components/E-image/index.vue' |
|
|
|
|
|
|
|
Vue.component('eimage', eimage) |
|
|
|
|
|
|
|
import Print from '@/utils/print' // 引入附件的js文件
|
|
|
|
Vue.use(Print) // 注册
|
|
|
|
Vue.use(VueAMap) |
|
|
|
VueAMap.initAMapApiLoader({ |
|
|
|
key: 'ccda12d8bffc72e9f1a32c599323a876', // 此处的key,在高德开放平台申请
|
|
|
|
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], // 此处的插件按需添加
|
|
|
|
v: '1.4.4', |
|
|
|
uiVersion: '1.0' |
|
|
|
}) |
|
|
|
|
|
|
|
Vue.config.productionTip = false |
|
|
|
|
|
|
|
import { setStorage, getStorage } from './utils/auth.js' |
|
|
|
let token = null |
|
|
|
token = GetQueryString('token') |
|
|
|
// token = getQueryVariable('token')
|
|
|
|
|
|
|
|
if (token) { |
|
|
|
setStorage(token) |
|
|
|
let href = window.location.href |
|
|
|
// href = href.split(`token=${token}`)[0]
|
|
|
|
// window.location.href = href.slice(0, href.length - 1)
|
|
|
|
setStorage(token) |
|
|
|
let href = window.location.href |
|
|
|
// href = href.split(`token=${token}`)[0]
|
|
|
|
// window.location.href = href.slice(0, href.length - 1)
|
|
|
|
} |
|
|
|
|
|
|
|
function GetQueryString(name) { |
|
|
|
var one = window.location.href.indexOf('?token=') + 7 |
|
|
|
if (one < 7) |
|
|
|
return null |
|
|
|
var two = window.location.href.lastIndexOf('&') // + 1
|
|
|
|
var data = window.location.href.substr(one) |
|
|
|
if (two > one) { |
|
|
|
data = window.location.href.slice(one, two) |
|
|
|
console.log('token', data) |
|
|
|
} |
|
|
|
if (data) { |
|
|
|
return data |
|
|
|
} |
|
|
|
return null |
|
|
|
// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
|
|
|
|
// var se = window.location.search.substr(1)
|
|
|
|
// var hr = window.location.href.substr(window.location.href.indexOf("?")+1)
|
|
|
|
// var r = hr.match( reg)
|
|
|
|
// if (r != null)
|
|
|
|
// return unescape(r[2]);
|
|
|
|
// return null
|
|
|
|
} |
|
|
|
|
|
|
|
function getQueryVariable(variable) { |
|
|
|
var query = window.location.search.substring(1) |
|
|
|
// console.log('main:query'+ query)
|
|
|
|
var vars = query.split('&') |
|
|
|
for (var i = 0; i < vars.length; i++) { |
|
|
|
var pair = vars[i].split('=') |
|
|
|
// console.log('main:pair-0', pair[0])
|
|
|
|
// console.log('main:pair-1', pair[1])
|
|
|
|
if (pair[0] == variable) { |
|
|
|
return pair[1] |
|
|
|
} |
|
|
|
} |
|
|
|
return (false) |
|
|
|
} |
|
|
|
|
|
|
|
var one = window.location.href.indexOf('&organizationData') + 18 |
|
|
|
if (parseInt(one) > 18) { |
|
|
|
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用
|
|
|
|
var data1 = decodeURIComponent(data) |
|
|
|
if (data1 !== undefined) { |
|
|
|
const obj = JSON.parse(data1) |
|
|
|
setDefaultOrgPath(obj.defaultOrgPath) |
|
|
|
setDefaultOrgPathName(obj.defaultOrgPathName) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取登录用户信息
|
|
|
@ -63,9 +125,9 @@ function getUserInfo() { |
|
|
|
dwjb: data.dwjb, |
|
|
|
orgNamePath: data.orgNamePath, // 使用组织全路径名称
|
|
|
|
orgSidPath: data.orgSidPath, // 使用组织全路径Sid
|
|
|
|
pNameAndDepartmentNameAndPostName:data.pNameAndDepartmentNameAndPostName |
|
|
|
pNameAndDepartmentNameAndPostName: data.pNameAndDepartmentNameAndPostName |
|
|
|
} |
|
|
|
// 结果存入缓存
|
|
|
|
//结果存入缓存
|
|
|
|
window.sessionStorage.setItem('staffSid', user.staffSid) |
|
|
|
window.sessionStorage.setItem('userSid', user.userSid) |
|
|
|
window.sessionStorage.setItem('Orgname', user.Orgname) |
|
|
@ -89,39 +151,4 @@ function getUserInfo() { |
|
|
|
|
|
|
|
getUserInfo() |
|
|
|
|
|
|
|
function GetQueryString(name) { |
|
|
|
var one = window.location.href.indexOf('?token=') + 7 |
|
|
|
if(one<7) |
|
|
|
return null; |
|
|
|
var two = window.location.href.lastIndexOf('&') //+ 1
|
|
|
|
var data = window.location.href.substr(one) |
|
|
|
if (two > one) { |
|
|
|
data = window.location.href.slice(one, two) |
|
|
|
console.log('token', data) |
|
|
|
} |
|
|
|
if (data) { |
|
|
|
return data |
|
|
|
} |
|
|
|
return null |
|
|
|
// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
|
|
|
|
// var r = window.location.search.substr(1).match(reg)
|
|
|
|
// if (r != null) return unescape(r[2]); return null
|
|
|
|
} |
|
|
|
|
|
|
|
import VueAMap from 'vue-amap' |
|
|
|
Vue.use(VueAMap) |
|
|
|
VueAMap.initAMapApiLoader({ |
|
|
|
key: 'ccda12d8bffc72e9f1a32c599323a876', // 此处的key,在高德开放平台申请
|
|
|
|
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], // 此处的插件按需添加
|
|
|
|
v: '1.4.4', |
|
|
|
uiVersion: '1.0' |
|
|
|
}) |
|
|
|
|
|
|
|
Vue.config.productionTip = false |
|
|
|
|
|
|
|
new Vue({ |
|
|
|
el: '#app', |
|
|
|
router, |
|
|
|
store, |
|
|
|
render: h => h(App) |
|
|
|
}) |
|
|
|
export default getUserInfo() |
|
|
|