perf: 动态访问前缀配置
This commit is contained in:
parent
1a0f218fc5
commit
5bbecb1589
@ -85,6 +85,9 @@ public class IndexController {
|
|||||||
@GetMapping("/tempMobileLink/{id}/{token}")
|
@GetMapping("/tempMobileLink/{id}/{token}")
|
||||||
public void tempMobileLink(@PathVariable("id") String id, @PathVariable("token") String token) {
|
public void tempMobileLink(@PathVariable("id") String id, @PathVariable("token") String token) {
|
||||||
String url = "/#preview/" + id;
|
String url = "/#preview/" + id;
|
||||||
|
if (StringUtils.isNotBlank(contextPath)) {
|
||||||
|
url = contextPath + url;
|
||||||
|
}
|
||||||
HttpServletResponse response = ServletUtils.response();
|
HttpServletResponse response = ServletUtils.response();
|
||||||
Cookie cookie = new Cookie("Authorization", token);
|
Cookie cookie = new Cookie("Authorization", token);
|
||||||
cookie.setPath("/");
|
cookie.setPath("/");
|
||||||
|
|||||||
@ -3,7 +3,7 @@ ENV = 'production'
|
|||||||
|
|
||||||
# base api
|
# base api
|
||||||
# VUE_APP_BASE_API = 'http://localhost:8081/'
|
# VUE_APP_BASE_API = 'http://localhost:8081/'
|
||||||
VUE_APP_BASE_API = '/'
|
VUE_APP_BASE_API = './'
|
||||||
|
|
||||||
VUE_CONTEXT_PATH = '/'
|
VUE_CONTEXT_PATH = './'
|
||||||
|
|
||||||
|
|||||||
@ -65,14 +65,14 @@ router.beforeEach(async(to, from, next) => routeBefore(() => {
|
|||||||
const hasToken = getToken()
|
const hasToken = getToken()
|
||||||
|
|
||||||
if (isMobile() && !to.path.includes(mobilePreview) && mobileIgnores.indexOf(to.path) === -1) {
|
if (isMobile() && !to.path.includes(mobilePreview) && mobileIgnores.indexOf(to.path) === -1) {
|
||||||
let urlSuffix = '/app.html'
|
let urlSuffix = 'app.html'
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
urlSuffix += ('?detoken=' + hasToken)
|
urlSuffix += ('?detoken=' + hasToken)
|
||||||
}
|
}
|
||||||
localStorage.removeItem('user-info')
|
localStorage.removeItem('user-info')
|
||||||
localStorage.removeItem('userId')
|
localStorage.removeItem('userId')
|
||||||
localStorage.removeItem('Authorization')
|
localStorage.removeItem('Authorization')
|
||||||
window.location.href = window.origin + urlSuffix
|
window.location.href = window.origin + window.location.pathname + urlSuffix
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ router.beforeEach(async(to, from, next) => routeBefore(() => {
|
|||||||
route = store.getters.permission_routes.find(item => item.path === '/')
|
route = store.getters.permission_routes.find(item => item.path === '/')
|
||||||
}
|
}
|
||||||
store.commit('permission/SET_CURRENT_ROUTES', route)
|
store.commit('permission/SET_CURRENT_ROUTES', route)
|
||||||
if (['system'].includes(route.name)) {
|
if (route?.name && ['system'].includes(route.name)) {
|
||||||
store.dispatch('app/toggleSideBarHide', false)
|
store.dispatch('app/toggleSideBarHide', false)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -3,5 +3,5 @@ ENV = 'production'
|
|||||||
|
|
||||||
# base api
|
# base api
|
||||||
# VUE_APP_BASE_API = 'http://localhost:8081/'
|
# VUE_APP_BASE_API = 'http://localhost:8081/'
|
||||||
VUE_APP_BASE_API = '/'
|
VUE_APP_BASE_API = './'
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@
|
|||||||
},
|
},
|
||||||
"h5": {
|
"h5": {
|
||||||
"router": {
|
"router": {
|
||||||
"base": "/de-app/"
|
"base": "./de-app/"
|
||||||
},
|
},
|
||||||
"devServer": {
|
"devServer": {
|
||||||
"proxy": {
|
"proxy": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user