feat(patient-h5): 接入签署令牌与签名上传
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
|
||||
import { signingState } from '@/composables/useSignFlow'
|
||||
import ConsentView from '@/views/consent/ConsentView.vue'
|
||||
import EntryView from '@/views/entry/EntryView.vue'
|
||||
import ResultView from '@/views/result/ResultView.vue'
|
||||
@@ -17,4 +18,24 @@ const router = createRouter({
|
||||
],
|
||||
})
|
||||
|
||||
router.beforeEach((to) => {
|
||||
if (to.path === '/entry') {
|
||||
return true
|
||||
}
|
||||
|
||||
if (signingState.status === 'idle') {
|
||||
return '/entry'
|
||||
}
|
||||
|
||||
if (to.path === '/signer' && !signingState.consentAccepted) {
|
||||
return '/consent'
|
||||
}
|
||||
|
||||
if (to.path === '/result' && !signingState.signatureCaptured) {
|
||||
return '/entry'
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user