添加一套访问http的后端地址
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
window._CONFIG = {}
|
window._CONFIG = {}
|
||||||
window._CONFIG['domianURL'] = '/jero-boot' // 路由转发 devServer
|
window._CONFIG['domianURL'] = '/jero-boot' // 路由转发 devServer
|
||||||
window._CONFIG['domianPreviewURL'] = localStorage.getItem('domianWebSocketURL') ? localStorage.getItem('domianWebSocketURL') : ''
|
window._CONFIG['domianPreviewURL'] = localStorage.getItem('domianPreviewURL') ? localStorage.getItem('domianPreviewURL') : ''
|
||||||
window._CONFIG['domianWebSocketURL'] = localStorage.getItem('domianWebSocketURL') ? localStorage.getItem('domianWebSocketURL') : ''
|
window._CONFIG['domianWebSocketURL'] = localStorage.getItem('domianWebSocketURL') ? localStorage.getItem('domianWebSocketURL') : ''
|
||||||
// 单点登录地址
|
// 单点登录地址
|
||||||
window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/download'
|
window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/download'
|
||||||
|
|||||||
@@ -171,7 +171,7 @@
|
|||||||
// 预览
|
// 预览
|
||||||
handlePreview(file) {
|
handlePreview(file) {
|
||||||
if (file && file.url) {
|
if (file && file.url) {
|
||||||
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
var fileFullUrl = `${window._CONFIG['domianPreviewURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
||||||
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||||
window.open(url)
|
window.open(url)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,7 +267,7 @@
|
|||||||
},
|
},
|
||||||
handlePreview(file) {
|
handlePreview(file) {
|
||||||
if (file && file.url) {
|
if (file && file.url) {
|
||||||
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
var fileFullUrl = `${window._CONFIG['domianPreviewURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
||||||
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||||
window.open(url)
|
window.open(url)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result.sysAllDictItems, 7 * 24 * 60 * 60 * 1000)
|
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result.sysAllDictItems, 7 * 24 * 60 * 60 * 1000)
|
||||||
Vue.ls.set('domianWebSocketURL', res.result.domianWebSocketURL)
|
Vue.ls.set('domianWebSocketURL', res.result.domianWebSocketURL)
|
||||||
Vue.ls.set('onlinePreviewDomainURL', res.result.onlinePreviewDomainURL)
|
Vue.ls.set('onlinePreviewDomainURL', res.result.onlinePreviewDomainURL)
|
||||||
|
Vue.ls.set('domianPreviewURL', res.result.domianPreviewURL)
|
||||||
store.commit('SET_TOKEN', res.result.token)
|
store.commit('SET_TOKEN', res.result.token)
|
||||||
store.commit('SET_INFO', res.result.userInfo)
|
store.commit('SET_INFO', res.result.userInfo)
|
||||||
store.commit('SET_NAME', {
|
store.commit('SET_NAME', {
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ const user = {
|
|||||||
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
|
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
|
||||||
Vue.ls.set('domianWebSocketURL', result.domianWebSocketURL)
|
Vue.ls.set('domianWebSocketURL', result.domianWebSocketURL)
|
||||||
Vue.ls.set('onlinePreviewDomainURL', result.onlinePreviewDomainURL)
|
Vue.ls.set('onlinePreviewDomainURL', result.onlinePreviewDomainURL)
|
||||||
|
Vue.ls.set('domianPreviewURL', result.domianPreviewURL)
|
||||||
commit('SET_TOKEN', result.token)
|
commit('SET_TOKEN', result.token)
|
||||||
commit('SET_INFO', userInfo)
|
commit('SET_INFO', userInfo)
|
||||||
commit('SET_NAME', { username: userInfo.username, realname: userInfo.realname, welcome: welcome() })
|
commit('SET_NAME', { username: userInfo.username, realname: userInfo.realname, welcome: welcome() })
|
||||||
@@ -131,11 +132,9 @@ const user = {
|
|||||||
const menuData = response.result.menu
|
const menuData = response.result.menu
|
||||||
const authData = response.result.auth
|
const authData = response.result.auth
|
||||||
const allAuthData = response.result.allAuth
|
const allAuthData = response.result.allAuth
|
||||||
window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
|
window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianPreviewURL') + '/jero-boot'
|
||||||
window._CONFIG['domianWebSocketURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
|
window._CONFIG['domianWebSocketURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
|
||||||
window._CONFIG['onlinePreviewDomainURL'] = Vue.ls.get('onlinePreviewDomainURL') + '/onlinePreview'
|
window._CONFIG['onlinePreviewDomainURL'] = Vue.ls.get('onlinePreviewDomainURL') + '/onlinePreview'
|
||||||
const onlinePreviewDomainURL = response.result.onlinePreviewDomainURL
|
|
||||||
const domianWebSocketURL = response.result.domianWebSocketURL
|
|
||||||
//Vue.ls.set(USER_AUTH,authData);
|
//Vue.ls.set(USER_AUTH,authData);
|
||||||
sessionStorage.setItem(USER_AUTH, JSON.stringify(authData))
|
sessionStorage.setItem(USER_AUTH, JSON.stringify(authData))
|
||||||
sessionStorage.setItem(SYS_BUTTON_AUTH, JSON.stringify(allAuthData))
|
sessionStorage.setItem(SYS_BUTTON_AUTH, JSON.stringify(allAuthData))
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import Vuex from 'vuex'
|
|||||||
import store from '@/store/'
|
import store from '@/store/'
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
// console.log(window._CONFIG['domianWebSocketURL'])
|
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
state: {
|
state: {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import Vuex from 'vuex'
|
|||||||
import store from '@/store/'
|
import store from '@/store/'
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
// console.log(window._CONFIG['domianWebSocketURL'])
|
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
state: {
|
state: {
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
},
|
},
|
||||||
handlePreview(record) {
|
handlePreview(record) {
|
||||||
if (record && record.url) {
|
if (record && record.url) {
|
||||||
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${record.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.fileName}`
|
var fileFullUrl = `${window._CONFIG['domianPreviewURL']}/sys/common/download/${record.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.fileName}`
|
||||||
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||||
window.open(url)
|
window.open(url)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user