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: {