@@ -84,6 +84,19 @@
}).catch(() => {
})
+ },
+ goBack() {
+ let ua = window.navigator.userAgent.toLocaleLowerCase()
+ if (ua.match(/MicroMessenger/i) == 'micromessenger') {
+ wx.miniProgram.getEnv(res => {
+ if (res.miniprogram) {
+ // 如果是微信小程序的话 直接返回小程序首页
+ wx.miniProgram.navigateBack()
+ } else {
+ this.$router.go(-1)
+ }
+ })
+ } else this.$router.go(-1)
}
}
}
diff --git a/vue.config.js b/vue.config.js
index fe2ed87..3f874eb 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -48,7 +48,7 @@ module.exports = defineConfig({
analyzerPort: 8888, //注意是否有端口冲突
reportFilename: 'report.html',
defaultSizes: 'parsed',
- openAnalyzer: true,
+ openAnalyzer: false,
generateStatsFile: false,
statsFilename: 'stats.json',
statsOptions: null,