From 2923c8c9d6d41cd51921acc1db6f1c58f8cfa697 Mon Sep 17 00:00:00 2001 From: RickCole21 Date: Fri, 28 Feb 2020 10:36:45 +0800 Subject: [PATCH] =?UTF-8?q?service=E5=91=BD=E4=B8=AD=E6=94=B9=E5=9B=9E?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Service.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderers/Form/Service.tsx b/src/renderers/Form/Service.tsx index 30b882c02..2c9cbcc43 100644 --- a/src/renderers/Form/Service.tsx +++ b/src/renderers/Form/Service.tsx @@ -8,7 +8,7 @@ import {observer} from 'mobx-react'; import {ServiceStore, IServiceStore} from '../../store/service'; @Renderer({ - test: /(^|\/)form(?:\/.+)?\/control\/(?:\d+\/)?service$/, + test: /(^|\/)form\/(.*)\/service$/, weight: -100, storeType: ServiceStore.name, storeExtendsData: false, @@ -25,7 +25,9 @@ export class ServiceRenderer extends BasicService { componentDidMount() { const {formInited, addHook} = this.props; - if (formInited) { + // form层级下的所有service应该都会走这里 + // 但是传入props有可能是undefined,所以做个处理 + if (formInited !== false) { super.componentDidMount(); } else { addHook && addHook(this.initFetch, 'init');