diff --git a/src/App.vue b/src/App.vue index 152a282f..6f113a15 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,7 +18,7 @@ export default { onPageNotFound() { }, computed: { - ...mapState(['token', 'user']), + ...mapState(['user']), }, methods: { ...mapMutations(['initWaterMarker', 'logout', 'getConfig', 'setApps']), diff --git a/src/apps/AppAskForm/AppForm.vue b/src/apps/AppAskForm/AppForm.vue index 3b10e7fe..7581334c 100644 --- a/src/apps/AppAskForm/AppForm.vue +++ b/src/apps/AppAskForm/AppForm.vue @@ -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() { diff --git a/src/apps/AppAskForm/components/formDetail.vue b/src/apps/AppAskForm/components/formDetail.vue index 97bb0b23..e71915bc 100644 --- a/src/apps/AppAskForm/components/formDetail.vue +++ b/src/apps/AppAskForm/components/formDetail.vue @@ -71,7 +71,7 @@ export default { name: "formDetail", inject: {root: {}}, computed: { - ...mapState(['openUser', 'token']), + ...mapState(['openUser']), isExam() { return this.form?.type == 1 }, diff --git a/src/apps/AppCreditPoints/AppCreditPoints.vue b/src/apps/AppCreditPoints/AppCreditPoints.vue index fc3b8793..933a2881 100644 --- a/src/apps/AppCreditPoints/AppCreditPoints.vue +++ b/src/apps/AppCreditPoints/AppCreditPoints.vue @@ -16,7 +16,7 @@ export default { name: "AppCreditPoints", appName: "我的积分", computed: { - ...mapState(['user', 'token']) + ...mapState(['user']) }, components: {SysUserIntegral, userRank, familyRank}, data() { diff --git a/src/apps/AppCreditPoints/components/familyRank.vue b/src/apps/AppCreditPoints/components/familyRank.vue index 101c18d6..de7fcedd 100644 --- a/src/apps/AppCreditPoints/components/familyRank.vue +++ b/src/apps/AppCreditPoints/components/familyRank.vue @@ -105,7 +105,7 @@ export default { name: "userRank", appName: "个人积分", computed: { - ...mapState(['user', 'token']) + ...mapState(['user']) }, props: { showDetail: { //true 积分明细 false积分排行 diff --git a/src/apps/AppCreditPoints/components/sysUserIntegral.vue b/src/apps/AppCreditPoints/components/sysUserIntegral.vue index 094c2227..8a76bfcb 100644 --- a/src/apps/AppCreditPoints/components/sysUserIntegral.vue +++ b/src/apps/AppCreditPoints/components/sysUserIntegral.vue @@ -27,14 +27,13 @@