|
@@ -4,6 +4,8 @@ import { BusinessFlowState, setBusinessFlow } from './BusinessFlowSlice';
|
|
|
import { setFeedbackOpen } from './exam/largeScreenSlice';
|
|
|
import { suspendOrCompleteStudy } from '@/API/patient/workActions';
|
|
|
import { RootState } from './store';
|
|
|
+import { getQuota } from '@/API/security/quotaActions';
|
|
|
+import { showQuotaAlert } from './security/quotaModalSlice';
|
|
|
|
|
|
let continueBusinessFlow = '';
|
|
|
|
|
@@ -24,6 +26,23 @@ const businessFlowMiddlewareLogic: Middleware =
|
|
|
);
|
|
|
//进入检查
|
|
|
if (action.payload === 'exam') {
|
|
|
+ //进入检查前判断配额
|
|
|
+ try {
|
|
|
+ const quotaResponse = await getQuota();
|
|
|
+ if (quotaResponse.data.available >= quotaResponse.data.total) {
|
|
|
+ store.dispatch(showQuotaAlert());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (quotaResponse.code !== '0x000000') {
|
|
|
+ store.dispatch(showQuotaAlert());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('[businessFlowMiddleware] Quota check failed:', error);
|
|
|
+ store.dispatch(showQuotaAlert());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
prepare();
|
|
|
return next(action);
|
|
|
}
|