-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from crawlab-team/develop
Develop
- Loading branch information
Showing
10 changed files
with
174 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ tmp/ | |
yarn.lock | ||
.DS_Store | ||
package-lock.json | ||
.umi/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
import dva from 'dva'; | ||
import { Component } from 'react'; | ||
import createLoading from 'dva-loading'; | ||
import history from '@tmp/history'; | ||
import dva from 'dva' | ||
import { Component } from 'react' | ||
import createLoading from 'dva-loading' | ||
import history from '@tmp/history' | ||
|
||
let app = null; | ||
let app = null | ||
|
||
export function _onCreate() { | ||
const plugins = require('umi/_runtimePlugin'); | ||
const runtimeDva = plugins.mergeConfig('dva'); | ||
const plugins = require('umi/_runtimePlugin') | ||
const runtimeDva = plugins.mergeConfig('dva') | ||
app = dva({ | ||
history, | ||
|
||
...(runtimeDva.config || {}), | ||
...(window.g_useSSR ? { initialState: window.g_initialData } : {}), | ||
}); | ||
}) | ||
|
||
app.use(createLoading()); | ||
(runtimeDva.plugins || []).forEach(plugin => { | ||
app.use(plugin); | ||
}); | ||
app.model({ namespace: 'article', ...(require('C:/Users/marvzhang/artipub/src/models/article.ts').default) }); | ||
app.model({ namespace: 'global', ...(require('C:/Users/marvzhang/artipub/src/models/global.ts').default) }); | ||
app.model({ namespace: 'login', ...(require('C:/Users/marvzhang/artipub/src/models/login.ts').default) }); | ||
app.model({ namespace: 'platform', ...(require('C:/Users/marvzhang/artipub/src/models/platform.ts').default) }); | ||
app.model({ namespace: 'setting', ...(require('C:/Users/marvzhang/artipub/src/models/setting.ts').default) }); | ||
app.model({ namespace: 'task', ...(require('C:/Users/marvzhang/artipub/src/models/task.ts').default) }); | ||
app.model({ namespace: 'user', ...(require('C:/Users/marvzhang/artipub/src/models/user.ts').default) }); | ||
return app; | ||
app.use(plugin) | ||
}) | ||
|
||
app.model({ namespace: 'article', ...(require('/Users/yeqing/projects/artipub/src/models/article.ts').default) }) | ||
app.model({ namespace: 'global', ...(require('/Users/yeqing/projects/artipub/src/models/global.ts').default) }) | ||
app.model({ namespace: 'login', ...(require('/Users/yeqing/projects/artipub/src/models/login.ts').default) }) | ||
app.model({ namespace: 'platform', ...(require('/Users/yeqing/projects/artipub/src/models/platform.ts').default) }) | ||
app.model({ namespace: 'setting', ...(require('/Users/yeqing/projects/artipub/src/models/setting.ts').default) }) | ||
app.model({ namespace: 'task', ...(require('/Users/yeqing/projects/artipub/src/models/task.ts').default) }) | ||
app.model({ namespace: 'user', ...(require('/Users/yeqing/projects/artipub/src/models/user.ts').default) }) | ||
return app | ||
} | ||
|
||
export function getApp() { | ||
return app; | ||
return app | ||
} | ||
|
||
export class _DvaContainer extends Component { | ||
render() { | ||
const app = getApp(); | ||
app.router(() => this.props.children); | ||
return app.start()(); | ||
const app = getApp() | ||
app.router(() => this.props.children) | ||
return app.start()() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.