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