配置文件更改
This commit is contained in:
parent
096dae3c14
commit
a351302a7e
|
|
@ -3,6 +3,7 @@ VUE_APP_TITLE = 档案预归档管理系统
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
VUE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 档案预归档管理系统/开发环境
|
# 档案预归档管理系统/开发环境
|
||||||
VUE_APP_BASE_API = '/dev-api'
|
VUE_APP_BASE_API = '/dev-api'
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ VUE_APP_TITLE = 档案预归档管理系统
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
VUE_APP_ENV = 'production'
|
||||||
|
|
||||||
# 档案预归档管理系统/生产环境
|
# 档案预归档管理系统/生产环境
|
||||||
VUE_APP_BASE_API = '/prod-api'
|
VUE_APP_BASE_API = '/smart-archiving-api'
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ export default {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
location.href = '/index'
|
location.href = process.env.VUE_APP_ENV === 'production'? '/smart-archiving/index': '/index'
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -255,5 +255,6 @@ Router.prototype.replace = function push(location) {
|
||||||
export default new Router({
|
export default new Router({
|
||||||
mode: 'history', // 去掉url中的#
|
mode: 'history', // 去掉url中的#
|
||||||
scrollBehavior: () => ({ y: 0 }),
|
scrollBehavior: () => ({ y: 0 }),
|
||||||
routes: constantRoutes
|
routes: constantRoutes,
|
||||||
|
base: process.env.VUE_APP_ENV === 'production'? '/smart-archiving': ''
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,8 @@ service.interceptors.request.use(
|
||||||
repeatSubmit = false,
|
repeatSubmit = false,
|
||||||
skipReplayProtection = false
|
skipReplayProtection = false
|
||||||
} = headers
|
} = headers
|
||||||
|
console.error(process.env.NODE_ENV);
|
||||||
|
|
||||||
// 设置请求头
|
// 设置请求头
|
||||||
config.headers['encryptRequest'] = systemConfig.requestConfig.encryptRequest && encryptRequest ? 'true' : 'false'
|
config.headers['encryptRequest'] = systemConfig.requestConfig.encryptRequest && encryptRequest ? 'true' : 'false'
|
||||||
config.headers['checkIntegrity'] = systemConfig.requestConfig.checkIntegrity && checkIntegrity ? 'true' : 'false'
|
config.headers['checkIntegrity'] = systemConfig.requestConfig.checkIntegrity && checkIntegrity ? 'true' : 'false'
|
||||||
|
|
@ -242,6 +243,33 @@ service.interceptors.response.use(
|
||||||
) {
|
) {
|
||||||
return res.data
|
return res.data
|
||||||
}
|
}
|
||||||
|
console.log(msg);
|
||||||
|
|
||||||
|
// 账号在其他设备登录的安全提示(基于后端返回信息关键词识别)
|
||||||
|
const otherDeviceLogin = /检测到您的账号已在其他设备登录/.test(String(msg || ''))
|
||||||
|
if (otherDeviceLogin) {
|
||||||
|
if (!isRelogin.show) {
|
||||||
|
isRelogin.show = true
|
||||||
|
MessageBox.alert(
|
||||||
|
'检测到您的账号已在其他设备登录,当前会话已下线。如非本人操作,请立即修改密码。',
|
||||||
|
'安全提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '重新登录',
|
||||||
|
type: 'warning',
|
||||||
|
callback: () => {
|
||||||
|
isRelogin.show = false
|
||||||
|
store.dispatch('LogOut').then(() => {
|
||||||
|
location.href =
|
||||||
|
process.env.VUE_APP_ENV === 'production'
|
||||||
|
? '/smart-archiving/index'
|
||||||
|
: '/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return Promise.reject('账号在其他设备登录,已强制下线。')
|
||||||
|
}
|
||||||
if (code === 401) {
|
if (code === 401) {
|
||||||
if (!isRelogin.show) {
|
if (!isRelogin.show) {
|
||||||
const currentPath = window.location.pathname
|
const currentPath = window.location.pathname
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
|
||||||
const name = process.env.VUE_APP_TITLE || '档案预归档管理系统' // 网页标题
|
const name = process.env.VUE_APP_TITLE || '档案预归档管理系统' // 网页标题
|
||||||
|
|
||||||
// const baseUrl = 'http://localhost:8080' // 后端接口
|
// const baseUrl = 'http://localhost:8080' // 后端接口
|
||||||
const baseUrl = 'http://192.168.0.39:8080' // 后端接口-福
|
const baseUrl = 'http://192.168.0.39:8080'
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ module.exports = {
|
||||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||||
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
||||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||||
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
publicPath: process.env.NODE_ENV === "production" ? "/smart-archiving/" : "/",
|
||||||
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue