Skip to content

Commit

Permalink
fix mix require / module.exports and import / export zuiidea#934
Browse files Browse the repository at this point in the history
  • Loading branch information
superlbr committed Jan 8, 2019
1 parent 0c6ea8e commit 10f8e3e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/models/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import store from 'store'
import { ROLE_TYPE } from 'utils/constant'
import { queryLayout, pathMatchRegexp } from 'utils'
import { CANCEL_REQUEST_MESSAGE } from 'utils/constant'
import { queryRouteList, logoutUser, queryUserInfo } from 'api'
import api from 'api'
import config from 'config'

const { queryRouteList, logoutUser, queryUserInfo } = api

export default {
namespace: 'app',
state: {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/dashboard/model.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { parse } from 'qs'
import modelExtend from 'dva-model-extend'
import { queryDashboard, queryWeather } from 'api'
import api from 'api'
import { pathMatchRegexp } from 'utils'
import { model } from 'utils/model'

const { queryDashboard, queryWeather } = api

export default modelExtend(model, {
namespace: 'dashboard',
state: {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/login/model.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { router, pathMatchRegexp } from 'utils'
import { loginUser } from 'api'
import api from 'api'

const { loginUser } = api

export default {
namespace: 'login',
Expand Down
4 changes: 3 additions & 1 deletion src/pages/post/model.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import modelExtend from 'dva-model-extend'
import { queryPostList } from 'api'
import api from 'api'
import { pathMatchRegexp } from 'utils'
import { pageModel } from 'utils/model'

const { queryPostList } = api

export default modelExtend(pageModel, {
namespace: 'post',

Expand Down
4 changes: 3 additions & 1 deletion src/pages/user/$id/models/detail.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { pathMatchRegexp } from 'utils'
import { queryUser } from 'api'
import api from 'api'

const { queryUser } = api

export default {
namespace: 'userDetail',
Expand Down
8 changes: 5 additions & 3 deletions src/pages/user/model.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/* global window */
import modelExtend from 'dva-model-extend'
import { pathMatchRegexp } from 'utils'
import {
import api from 'api'
import { pageModel } from 'utils/model'

const {
queryUserList,
createUser,
removeUser,
updateUser,
removeUserList,
} from 'api'
import { pageModel } from 'utils/model'
} = api

export default modelExtend(pageModel, {
namespace: 'user',
Expand Down
2 changes: 1 addition & 1 deletion src/services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ APIFunction.queryWeather = params => {
})
}

module.exports = APIFunction
export default APIFunction
2 changes: 1 addition & 1 deletion src/utils/city.js
Original file line number Diff line number Diff line change
Expand Up @@ -4052,4 +4052,4 @@ let DICT_FIXED = (function() {
return tree(fixed)
})()

module.exports = DICT_FIXED
export default DICT_FIXED

0 comments on commit 10f8e3e

Please sign in to comment.