ソースを参照

登录区分bom和workload

xjj 2 年 前
コミット
bea2a1afae

+ 1 - 0
src/pages/PurchaseAdmin/PurchaseList/Index.js

@@ -24,6 +24,7 @@ function LayoutDetail(props) {
     props.dispatch({
       type: 'user/fetchCurrent',
     });
+    localStorage.type = 'bom'
   }, []);
   const checkReport = state => {
     if (isAdmin) return true;

+ 3 - 2
src/pages/PurchaseAdmin/PurchaseList/Login/Login.js

@@ -48,6 +48,7 @@ const copyright = (
 class LoginPage extends Component {
   state = {
     type: 'account',
+    loginType: localStorage.type,
     autoLogin: true,
     depList: [],
     userName: '',
@@ -111,9 +112,9 @@ class LoginPage extends Component {
 
   render() {
     const { login, submitting } = this.props;
-    const { type, autoLogin, depList, depId } = this.state;
+    const { type, autoLogin, depList, depId, loginType } = this.state;
     return (
-      <DocumentTitle title="登录-采购清单">
+      <DocumentTitle title={`登录-${loginType == 'bom' ? '采购清单' : '人日'}`}>
         <div className={styles.container}>
           <div className={styles.content}>
             <div className={styles.main}>

+ 5 - 2
src/pages/PurchaseAdmin/PurchaseList/Login/models/login.js

@@ -25,8 +25,11 @@ export default {
         type: 'changeLoginStatus',
         payload: response,
       });
-
-      yield put(routerRedux.replace('/home'));
+      if(localStorage.type == 'bom') {
+        yield put(routerRedux.replace('/home'));
+      } else {
+        yield put(routerRedux.replace('/workload'));
+      }
     },
     *logout(_, { call, put }) {
       yield call(Logout);

+ 1 - 0
src/pages/PurchaseAdmin/PurchaseList/WorkloadIndex.js

@@ -24,6 +24,7 @@ function LayoutDetail(props) {
     props.dispatch({
       type: 'user/fetchCurrent',
     });
+    localStorage.type = 'workload'
   }, []);
   const checkReport = state => {
     if (isAdmin) return true;