Browse Source

uas手机版
清除所有缓存数据

RaoMeng 5 years ago
parent
commit
f465d58aa2

+ 2 - 12
uas-office-web/uas-mobile/src/pages/common/UasEntry.jsx

@@ -5,12 +5,7 @@
 
 import React, { Component } from 'react'
 import { connect } from 'react-redux'
-import { clearHomeState } from '../../redux/actions/homeState'
-import { clearMainState } from '../../redux/actions/mainState'
-import { clearReportState } from '../../redux/actions/reportState'
-import { clearDocState } from '../../redux/actions/docState'
-import { clearUserInfo } from '../../redux/actions/userState'
-import { clearListState } from '../../redux/actions/listState'
+import { clearAllRedux } from '../../redux/utils/redux.utils'
 
 class UasEntry extends Component {
 
@@ -23,12 +18,7 @@ class UasEntry extends Component {
   componentDidMount () {
     document.title = 'UAS系统'
 
-    clearHomeState()
-    clearMainState()
-    clearReportState()
-    clearDocState()
-    clearListState()
-    clearUserInfo()
+    clearAllRedux()
 
     this.props.history.replace('/homePage')
   }

+ 23 - 0
uas-office-web/uas-mobile/src/redux/utils/redux.utils.js

@@ -0,0 +1,23 @@
+import { clearHomeState } from '../actions/homeState'
+import { clearMainState } from '../actions/mainState'
+import { clearReportState } from '../actions/reportState'
+import { clearDocState } from '../actions/docState'
+import { clearListState } from '../actions/listState'
+import { clearUserInfo } from '../actions/userState'
+
+/**
+ * Created by RaoMeng on 2020/12/14
+ * Desc: redux全局方法
+ */
+
+/**
+ * 清除所有redux缓存数据
+ */
+export function clearAllRedux () {
+  clearHomeState()
+  clearMainState()
+  clearReportState()
+  clearDocState()
+  clearListState()
+  clearUserInfo()
+}