fix:前端端口修改
This commit is contained in:
@@ -2,7 +2,7 @@ ENV = 'development'
|
||||
|
||||
# 接口地址
|
||||
VUE_APP_BASE_API = 'http://localhost:8011'
|
||||
VUE_APP_WS_API = 'ws://localhost:8011'
|
||||
VUE_APP_WS_API = 'ws://localhost:801'
|
||||
|
||||
# 是否启用 babel-plugin-dynamic-import-node插件
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
@@ -2,6 +2,6 @@ ENV = 'production'
|
||||
|
||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||
VUE_APP_BASE_API = 'http://10.93.41.201:8010'
|
||||
VUE_APP_BASE_API = 'http://10.93.41.201:8011'
|
||||
# 如果接口是 http 形式, wss 需要改为 ws
|
||||
VUE_APP_WS_API = 'ws://10.93.41.201:8010'
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
window.g = {
|
||||
dev: {
|
||||
VUE_APP_BASE_API: 'http://127.0.0.1:8013'
|
||||
VUE_APP_BASE_API: 'http://127.0.0.1:8011'
|
||||
},
|
||||
prod: {
|
||||
VUE_APP_BASE_API: 'http://127.0.0.1:8013'
|
||||
VUE_APP_BASE_API: 'http://127.0.0.1:8011'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,16 +5,15 @@ import 'nprogress/nprogress.css' // progress bar style
|
||||
import { getToken } from '@/utils/auth' // getToken from cookie
|
||||
import { buildMenus } from '@/views/system/menu/menu'
|
||||
import { filterAsyncRouter } from '@/store/modules/permission'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
NProgress.configure({ showSpinner: false })// NProgress Configuration
|
||||
|
||||
const whiteList = ['/login', '/expand']// no redirect whitelist
|
||||
const whiteList = ['/login']// no redirect whitelist
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.meta.title) {
|
||||
// document.title = to.meta.title + ' - ' + Config.title
|
||||
document.title = i18n.t(to.meta.title)
|
||||
document.title = to.meta.title
|
||||
}
|
||||
NProgress.start()
|
||||
if (getToken()) {
|
||||
@@ -59,7 +58,8 @@ export const loadMenus = (next, to) => {
|
||||
const sidebarRoutes = filterAsyncRouter(sdata)
|
||||
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
||||
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
|
||||
store.dispatch('GenerateRoutes', rewriteRoutes).then(() => { // 存储路由
|
||||
|
||||
store.dispatch('GenerateRoutes', rewriteRoutes).then(() => {
|
||||
router.addRoutes(rewriteRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true })
|
||||
})
|
||||
|
||||
@@ -21,6 +21,7 @@ service.interceptors.request.use(
|
||||
config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
config.headers['Content-Type'] = 'application/json'
|
||||
config.headers['Accept-Language'] = window.localStorage.getItem('lang')
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
|
||||
Reference in New Issue
Block a user