整合企微token变量

This commit is contained in:
aixianling
2022-07-19 18:06:22 +08:00
parent 36852052ec
commit eda5128d4b
31 changed files with 170 additions and 207 deletions

View File

@@ -23,7 +23,7 @@ export default {
}
},
computed: {
...mapState(['user', 'token']),
...mapState(['user']),
showDetail() {
return !!this.$route.query?.id && this.access
},
@@ -40,11 +40,11 @@ export default {
},
methods: {
...mapActions(['getCode', 'getToken']),
checkAccess() {
let {corpId, code, suiteId, id} = this.$route.query
checkAccess(review) {
let {code, suiteId, id} = this.$route.query
if (this.isPreview) {
this.access = true
} else if (!!this.token) {
} else if (!!this.user.token) {
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, {
params: {id}
}).then(res => {
@@ -57,12 +57,10 @@ export default {
this.err = err
})
} 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()
this.getToken({code, suiteId}).then(() => this.checkAccess(true))
} else if (!review) this.getCode()
else this.err = "登录失败!"
},
},
created() {

View File

@@ -71,7 +71,7 @@ export default {
name: "formDetail",
inject: {root: {}},
computed: {
...mapState(['openUser', 'token']),
...mapState(['openUser']),
isExam() {
return this.form?.type == 1
},