update #91
@ -668,19 +668,10 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 首页跳转方法 - 根据域名判断跳转到不同的首页
|
// 首页跳转方法 - 使用 getHomePath 的结果进行跳转(更可靠)
|
||||||
goHome() {
|
goHome() {
|
||||||
console.log('=== goHome 方法开始 ===');
|
const path = this.homePath || getHomePath();
|
||||||
console.log('当前完整URL:', window.location.href);
|
this.$router.push(path);
|
||||||
console.log('当前hostname:', window.location.hostname);
|
|
||||||
console.log('isNcmatchDomain判断结果:', this.isNcmatchDomain);
|
|
||||||
console.log('准备跳转的路径:', this.isNcmatchDomain ? '/ncmatchHome/index' : '/homePage/index');
|
|
||||||
|
|
||||||
if (this.isNcmatchDomain) {
|
|
||||||
this.$router.push('/ncmatchHome/index');
|
|
||||||
} else {
|
|
||||||
this.$router.push('/homePage/index');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@ -76,31 +76,31 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 生产环境去除console和debugger
|
// 生产环境去除console和debugger
|
||||||
optimization: {
|
// optimization: {
|
||||||
minimizer: [
|
// minimizer: [
|
||||||
{
|
// {
|
||||||
apply: (compiler) => {
|
// apply: (compiler) => {
|
||||||
// 只在生产环境生效
|
// // 只在生产环境生效
|
||||||
if (process.env.NODE_ENV === 'production') {
|
// if (process.env.NODE_ENV === 'production') {
|
||||||
const TerserPlugin = require('terser-webpack-plugin')
|
// const TerserPlugin = require('terser-webpack-plugin')
|
||||||
new TerserPlugin({
|
// new TerserPlugin({
|
||||||
terserOptions: {
|
// terserOptions: {
|
||||||
compress: {
|
// compress: {
|
||||||
drop_console: true, // 移除console
|
// drop_console: true, // 移除console
|
||||||
drop_debugger: true, // 移除debugger
|
// drop_debugger: true, // 移除debugger
|
||||||
pure_funcs: ['console.log', 'console.info', 'console.warn', 'console.error'] // 移除特定的console方法
|
// pure_funcs: ['console.log', 'console.info', 'console.warn', 'console.error'] // 移除特定的console方法
|
||||||
},
|
// },
|
||||||
mangle: true, // 代码混淆
|
// mangle: true, // 代码混淆
|
||||||
output: {
|
// output: {
|
||||||
comments: false // 移除注释
|
// comments: false // 移除注释
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}).apply(compiler)
|
// }).apply(compiler)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
chainWebpack(config) {
|
chainWebpack(config) {
|
||||||
// it can improve the speed of the first screen, it is recommended to turn on preload
|
// it can improve the speed of the first screen, it is recommended to turn on preload
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user