diff --git a/pc4mobx/hrmSalary/config.js b/pc4mobx/hrmSalary/config.js index 8da60ccc..958c63f2 100644 --- a/pc4mobx/hrmSalary/config.js +++ b/pc4mobx/hrmSalary/config.js @@ -22,3 +22,4 @@ export const PAGE = { "dataPush": ["/hrmSalary/datapush"], //数据推送 "adjustRecord": ["/hrmSalary/adjustSalaryManage"] //调薪管理 }; +export const EXCLUDE_PAGE=["mobilepayroll"] diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index 0405b3bd..75ea973f 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -11,6 +11,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import Authority from "./pages/mySalary/authority"; +import { EXCLUDE_PAGE } from "./config"; import stores from "./stores"; const { ls } = WeaTools; @@ -46,8 +47,10 @@ class Layout extends Component { let header = document.getElementById("container"); header.appendChild(link); top.$(".ant-message").remove(); - window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); - window.location.hash.indexOf("mobilepayroll") !== -1 && stores.taxAgentStore.initPageAndOptAuth(); + _.map(EXCLUDE_PAGE, page => { + if (window.location.hash.indexOf(page) === -1) stores.taxAgentStore.getPermission(); + if (window.location.hash.indexOf(page) !== -1) stores.taxAgentStore.initPageAndOptAuth(); + }); } window.addEventListener("storage", this.setFontSize); } diff --git a/pc4mobx/hrmSalary/single.js b/pc4mobx/hrmSalary/single.js index 1de2325b..7fd825af 100644 --- a/pc4mobx/hrmSalary/single.js +++ b/pc4mobx/hrmSalary/single.js @@ -1,16 +1,11 @@ import React from "react"; import ReactDOM from "react-dom"; - import { createHashHistory } from "History"; - import { IndexRedirect, Route, Router, useRouterHistory } from "react-router"; - import { RouterStore, syncHistoryWithStore } from "mobx-react-router"; - +import { EXCLUDE_PAGE } from "./config"; import { Provider } from "mobx-react"; - import Module from "weaHrmSalary"; -import stores from "./stores"; const routing = new RouterStore(); @@ -30,16 +25,18 @@ const Home = props => props.children; class Root extends React.Component { componentWillMount() { - const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css" - const link = document.createElement("link") - link.setAttribute('rel','stylesheet'); - link.setAttribute('type','text/css'); - link.setAttribute('href',src); - let header = document.getElementById("container") - header.appendChild(link) + const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; + const link = document.createElement("link"); + link.setAttribute("rel", "stylesheet"); + link.setAttribute("type", "text/css"); + link.setAttribute("href", src); + let header = document.getElementById("container"); + header.appendChild(link); top.$(".ant-message").remove(); - window.location.hash.indexOf("mobilepayroll") === -1 && allStore.taxAgentStore.getPermission(); - window.location.hash.indexOf("mobilepayroll") !== -1 && allStore.taxAgentStore.initPageAndOptAuth(); + _.map(EXCLUDE_PAGE, page => { + if (window.location.hash.indexOf(page) === -1) allStore.taxAgentStore.getPermission(); + if (window.location.hash.indexOf(page) !== -1) allStore.taxAgentStore.initPageAndOptAuth(); + }); if (window.location.hash.indexOf("payroll") !== -1) { window.localStorage.removeItem("template-basedata"); window.localStorage.removeItem("salary-showset");