mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
修复app 渲染器页面 schemaApi 用法会存在 api 请求混乱问题
This commit is contained in:
parent
503eb4cfa7
commit
c559cc1b82
@ -386,7 +386,7 @@ export default class App extends React.Component<AppProps, object> {
|
||||
) : null}
|
||||
|
||||
{render('page', store.schema, {
|
||||
key: store.activePage?.id,
|
||||
key: `${store.activePage?.id}-${store.schemaKey}`,
|
||||
data: store.pageData
|
||||
})}
|
||||
</>
|
||||
|
@ -162,7 +162,9 @@ export const AppStore = ServiceStore.named('AppStore')
|
||||
|
||||
if (page.schema) {
|
||||
self.schema = page.schema;
|
||||
self.schemaKey = '' + Date.now();
|
||||
} else if (page.schemaApi) {
|
||||
self.schema = null;
|
||||
self.fetchSchema(page.schemaApi, self.activePage);
|
||||
} else if (page.redirect) {
|
||||
env.jumpTo(page.redirect);
|
||||
@ -171,6 +173,7 @@ export const AppStore = ServiceStore.named('AppStore')
|
||||
this.rewrite(page.rewrite, env);
|
||||
} else {
|
||||
self.schema = null;
|
||||
self.schemaKey = '';
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user