微信登录问题修复
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import {mapActions, mapState} from "vuex";
|
||||
import {mapState} from "vuex";
|
||||
import AiTextarea from "../../components/AiTextarea";
|
||||
import AiUploader from "../../components/AiUploader";
|
||||
import AiSelect from "../../components/AiSelect";
|
||||
@@ -76,6 +76,7 @@ import AiBack from "../../components/AiBack";
|
||||
|
||||
export default {
|
||||
name: "formDetail",
|
||||
inject: {root: {}},
|
||||
components: {
|
||||
AiBack,
|
||||
AiImage,
|
||||
@@ -90,11 +91,11 @@ export default {
|
||||
isExam() {
|
||||
return this.form?.type == 1
|
||||
},
|
||||
isPreview() {
|
||||
return !!this.$route.query?.preview
|
||||
},
|
||||
isResult() {
|
||||
return !!this.$route.query?.result
|
||||
},
|
||||
isPreview() {
|
||||
return !!this.$route.query?.preview
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -125,10 +126,20 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getUserInfo', "getCode"]),
|
||||
getForm() {
|
||||
let {id} = this.$route.query
|
||||
this.$http.post("/app/appquestionnairetemplate/queryDetailById", null, {
|
||||
withoutToken: true,
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.form = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getResult() {
|
||||
let {id} = this.$route.query
|
||||
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
@@ -207,45 +218,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
checkForm() {
|
||||
if (this.isPreview) {
|
||||
this.checkUser = true
|
||||
return Promise.resolve()
|
||||
}
|
||||
let {query: {id}} = this.$route,
|
||||
{openId} = this.openUser
|
||||
if (openId) {
|
||||
return new Promise(resolve => {
|
||||
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, {
|
||||
params: {id, openId}
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.checkUser = true
|
||||
if (this.isResult && res?.data) {
|
||||
this.form = res?.data
|
||||
} else resolve()
|
||||
} else this.result = {
|
||||
tips: "调查问卷加载失败",
|
||||
status: "error",
|
||||
btn: "重新加载",
|
||||
btnTap() {
|
||||
location.reload()
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
this.result = {
|
||||
tips: err || "调查问卷加载失败",
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
let {corpId} = this.$route.query
|
||||
this.getCode({corpId, url: location.href})
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.checkForm()?.then(() => this.checkUser && this.getForm())
|
||||
this.isResult ? this.getResult() : this.getForm()
|
||||
},
|
||||
mounted() {
|
||||
document.title = this.form.title || "调查问卷"
|
||||
|
||||
Reference in New Issue
Block a user