From d80eef16e7913260735a5a18f839961881bd5680 Mon Sep 17 00:00:00 2001 From: xianruiyang Date: Tue, 21 Nov 2023 16:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=92=8C=E5=8F=91=E5=B8=83ur?= =?UTF-8?q?l=E6=94=AF=E6=8C=81=E4=BA=8C=E7=BA=A7=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E6=96=B9=E5=BC=8F=E4=B8=8B=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/form/preview/index.vue | 5 ++++- src/views/form/publish/index.vue | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/form/preview/index.vue b/src/views/form/preview/index.vue index 935b09f..f53d5bf 100644 --- a/src/views/form/preview/index.vue +++ b/src/views/form/preview/index.vue @@ -74,7 +74,10 @@ export default { mounted() { this.formKey = this.$route.query.key let url = window.location.protocol + '//' + window.location.host - this.mobilePreviewUrl = `${url}/project/form/view?key=${this.formKey}` + // 支持二级目录访问 + let publicPath = process.env.BASE_URL || '/' + let modeSign = this.$router.mode == 'hash' ? '#' : '' + this.mobilePreviewUrl = `${url}${publicPath}${modeSign}/project/form/view?key=${this.formKey}` this.$set(this.formConfig, 'formKey', this.formKey) } } diff --git a/src/views/form/publish/index.vue b/src/views/form/publish/index.vue index cf7b233..950e630 100644 --- a/src/views/form/publish/index.vue +++ b/src/views/form/publish/index.vue @@ -90,7 +90,10 @@ export default { mounted() { this.formKey = this.$route.query.key let url = window.location.protocol + '//' + window.location.host - this.writeLink = `${url}/s/${this.formKey}` + // 支持二级目录访问 + let publicPath = process.env.BASE_URL || '/' + let modeSign = this.$router.mode == 'hash' ? '#' : '' + this.writeLink = `${url}${publicPath}${modeSign}/s/${this.formKey}` this.getProjectStatus() }, methods: {