微信登录问题修复
This commit is contained in:
@@ -8,22 +8,53 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
import {mapActions, mapState} from "vuex";
|
||||
import FormDetail from "./formDetail";
|
||||
import AiResult from "../../components/AiResult";
|
||||
|
||||
export default {
|
||||
name: "AppForm",
|
||||
appName: "问卷表单",
|
||||
inject: {root: {}},
|
||||
components: {AiResult, FormDetail},
|
||||
data() {
|
||||
return {
|
||||
access: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['openUser', 'user']),
|
||||
...mapState(['user', 'token']),
|
||||
showDetail() {
|
||||
return !!this.$route.query?.id
|
||||
return !!this.$route.query?.id && this.access
|
||||
},
|
||||
errMsg() {
|
||||
return this.showDetail ? "加载表单中..." : "表单不存在"
|
||||
return this.access ? "表单不存在" : "无法获取用户信息"
|
||||
},
|
||||
isPreview() {
|
||||
return !!this.$route.query?.preview
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getCode', 'getToken']),
|
||||
checkAccess() {
|
||||
let {corpId, code, suiteId} = this.$route.query
|
||||
if (this.isPreview) {
|
||||
this.access = true
|
||||
} else if (!!this.token) {
|
||||
this.access = true
|
||||
} else if (code) {
|
||||
this.getToken({code, corpId, suiteId, isAppForm: true}).then(() => {
|
||||
let {query, path, hash} = this.$route
|
||||
delete query.code
|
||||
this.root.goto({query, path, hash})
|
||||
})
|
||||
} else {
|
||||
this.getCode({corpId, url: location.href})
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.checkAccess()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user