Commit 1895c08397113d5dba9d6d947e60de606a958a31
1 parent
af748ea6
优化代码;
Showing
11 changed files
with
21 additions
and
31 deletions
src/components/Common/PersonCenter/PersonCenter.js
| ... | ... | @@ -38,7 +38,6 @@ const FormItem = Form.Item; |
| 38 | 38 | |
| 39 | 39 | class PersonCenter extends Component { |
| 40 | 40 | constructor(props) { |
| 41 | - console.log('=====props', props); | |
| 42 | 41 | super(props); |
| 43 | 42 | this.changePwd = localStorage.getItem(`${commonConfig.prefix}changePwd`) === 'true'; |
| 44 | 43 | this.state = { | ... | ... |
src/components/IndexCenter/IndexCenter.js
| ... | ... | @@ -87,7 +87,6 @@ class IndexCenter extends Component { |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | componentWillMount() { |
| 90 | - console.log('=====componentWillMount'); | |
| 91 | 90 | setTimeout(() => { |
| 92 | 91 | this.handleGetModelCenter('init'); |
| 93 | 92 | const commonUrl = `${config.server_host}parameter/getParameter?sModelsId=100`; | ... | ... |
src/models/app.js
| ... | ... | @@ -249,7 +249,7 @@ export default { |
| 249 | 249 | currentPane: pane, |
| 250 | 250 | }, |
| 251 | 251 | }); |
| 252 | - yield put(history.push(pane.route)); | |
| 252 | + history.push(pane.route); | |
| 253 | 253 | } |
| 254 | 254 | }, |
| 255 | 255 | *addPane({ payload }, { put, select }) { |
| ... | ... | @@ -308,7 +308,8 @@ export default { |
| 308 | 308 | const { currentPane } = payload; |
| 309 | 309 | yield put({ type: 'setCurrentPane', payload: { currentPane } }); |
| 310 | 310 | const routeLine = currentPane.route ? currentPane.route : '/indexPage'; |
| 311 | - yield put(history.push(routeLine)); | |
| 311 | + // yield put(history.push(routeLine)); | |
| 312 | + history.push(routeLine) | |
| 312 | 313 | }, |
| 313 | 314 | *throwError({ payload }, { put, select }) { |
| 314 | 315 | const { code, msg, fn } = payload; |
| ... | ... | @@ -319,9 +320,9 @@ export default { |
| 319 | 320 | yield put({ type: 'saveWebSocket', payload: { webSocket: null } }); |
| 320 | 321 | yield put({ type: 'saveToken', payload: {} }); |
| 321 | 322 | if (location.pathname.toLowerCase() === '/loginoee') { |
| 322 | - yield put(history.push('/loginOee')); | |
| 323 | + history.push('/loginOee'); | |
| 323 | 324 | } else { |
| 324 | - yield put(history.push('/login')); | |
| 325 | + history.push('/login'); | |
| 325 | 326 | } |
| 326 | 327 | message.destroy(); |
| 327 | 328 | message.error(msg, ERROR_MSG_DURATION); |
| ... | ... | @@ -365,7 +366,7 @@ export default { |
| 365 | 366 | commonFunc.onWebSocketClose(webSocket, false, null); |
| 366 | 367 | yield put({ type: 'saveWebSocket', payload: { webSocket: null } }); |
| 367 | 368 | yield put({ type: 'saveToken', payload: {} }); |
| 368 | - yield put(history.push('/loginMobile')); | |
| 369 | + history.push('/loginMobile'); | |
| 369 | 370 | message.destroy(); |
| 370 | 371 | message.error(msg, ERROR_MSG_DURATION); |
| 371 | 372 | } else { |
| ... | ... | @@ -381,7 +382,7 @@ export default { |
| 381 | 382 | commonFunc.onWebSocketClose(webSocket, false, null); |
| 382 | 383 | yield put({ type: 'saveWebSocket', payload: { webSocket: null } }); |
| 383 | 384 | yield put({ type: 'saveToken', payload: {} }); |
| 384 | - yield put(history.push('/loginOee')); | |
| 385 | + history.push('/loginOee'); | |
| 385 | 386 | message.destroy(); |
| 386 | 387 | message.error(msg, ERROR_MSG_DURATION); |
| 387 | 388 | } else { |
| ... | ... | @@ -400,11 +401,11 @@ export default { |
| 400 | 401 | yield put({ type: 'saveWebSocket', payload: { webSocket: null } }); |
| 401 | 402 | yield put({ type: 'saveToken', payload: {} }); |
| 402 | 403 | if (loginOutType === 'loginOut') { |
| 403 | - yield put(history.push('/login')); | |
| 404 | + history.push('/login'); | |
| 404 | 405 | } else if (loginOutType === 'loginMobileOut') { |
| 405 | - yield put(history.push('/loginMobile')); | |
| 406 | + history.push('/loginMobile'); | |
| 406 | 407 | } else if (loginOutType === 'loginOeeOut') { |
| 407 | - yield put(history.push('/loginOee')); | |
| 408 | + history.push('/loginOee'); | |
| 408 | 409 | } |
| 409 | 410 | } else if (loginOutType === 'loginOut') { |
| 410 | 411 | yield put({ type: 'throwError', payload: data }); |
| ... | ... | @@ -434,7 +435,7 @@ export default { |
| 434 | 435 | if (editPwdType === 'mobile') { |
| 435 | 436 | if (data.code === 1) { |
| 436 | 437 | // Toast.success(data.msg, 1); |
| 437 | - yield put(history.push('loginMobile')); | |
| 438 | + history.push('loginMobile'); | |
| 438 | 439 | } else { |
| 439 | 440 | // Toast.fail(data.msg, 1); |
| 440 | 441 | // yield put({ type: 'throwError', payload: data }); |
| ... | ... | @@ -442,14 +443,14 @@ export default { |
| 442 | 443 | } else if (editPwdType === 'window') { |
| 443 | 444 | if (data.code === 1) { |
| 444 | 445 | message.success(data.msg); |
| 445 | - yield put(history.push('/login')); | |
| 446 | + history.push('/login'); | |
| 446 | 447 | } else { |
| 447 | 448 | yield put({ type: 'throwError', payload: data }); |
| 448 | 449 | } |
| 449 | 450 | } else if (editPwdType === 'oee') { |
| 450 | 451 | if (data.code === 1) { |
| 451 | 452 | message.success(data.msg); |
| 452 | - yield put(history.push('/loginOee')); | |
| 453 | + history.push('/loginOee'); | |
| 453 | 454 | } else { |
| 454 | 455 | yield put({ type: 'throwError', payload: data }); |
| 455 | 456 | } |
| ... | ... | @@ -461,7 +462,7 @@ export default { |
| 461 | 462 | const { data } = yield call(services.postValueService, token, value, url); |
| 462 | 463 | if (data.code === 1) { |
| 463 | 464 | message.success(data.msg); |
| 464 | - yield put(history.push('/login')); | |
| 465 | + history.push('/login'); | |
| 465 | 466 | } else { |
| 466 | 467 | yield put({ type: 'throwError', payload: data }); |
| 467 | 468 | } | ... | ... |
src/routes/indexCenter/indexCenter.js
src/routes/indexPage.js
src/routes/login/login.js
src/routes/menuPanel/menuPanel.js
src/routes/personCenter/personCenter.js
src/routes/tab/tab.js
src/services/services.js
| ... | ... | @@ -10,7 +10,6 @@ export function getService(token, url, app = undefined) { |
| 10 | 10 | }, |
| 11 | 11 | }; |
| 12 | 12 | const result = request(url, options, app); |
| 13 | - console.log('=====result', result); | |
| 14 | 13 | return result; |
| 15 | 14 | } catch (e) { |
| 16 | 15 | console.log(e.message); |
| ... | ... | @@ -28,11 +27,8 @@ export function postValueService(token, value, url, app) { |
| 28 | 27 | }, |
| 29 | 28 | body: JSON.stringify(value), |
| 30 | 29 | }; |
| 31 | - const result = request(url, options, app); | |
| 32 | - console.log('=====result1', url, result); | |
| 33 | - return result; | |
| 30 | + return request(url, options, app); | |
| 34 | 31 | } catch (e) { |
| 35 | - console.log('=====result11', e); | |
| 36 | 32 | console.log(e.message); |
| 37 | 33 | return {}; |
| 38 | 34 | } | ... | ... |