"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[717],{52936:function(se,T,t){t.r(T),t.d(T,{default:function(){return te}});var O=t(97857),f=t.n(O),F=t(5574),C=t.n(F),g=t(67294),A=t(26058),Z=t(92398),u=t(30518),B=t(22181),L=t(83622),R={"/test/index":["/test/index"],"/Invoicing/index":["/Invoicing/index"]},M=R,a=t(85893),H=function(e){var n,s=e.user,o=e.children,l=s.authority,c=(0,u.useLocation)(),i=c.pathname,p=(n=M[i])===null||n===void 0?void 0:n.some(function(y){return l.includes(y)});console.log("authority",M),console.log("userAuthority",l),console.log("children",o);var d=o;return p||(d=(0,a.jsx)(B.ZP,{title:"403",status:"403",subTitle:"\u5BF9\u4E0D\u8D77, \u60A8\u6CA1\u6709\u8BBF\u95EE\u6B64\u9875\u9762\u7684\u6743\u9650",extra:(0,a.jsx)(L.ZP,{type:"primary",onClick:function(){return u.history.push("/")},children:"\u8FD4\u56DE\u9996\u9875"})})),d},K=(0,u.connect)(function(r){var e=r.user;return{user:e}})(H),N=t(74330),V={"/auth":{target:"https://es.robot-z.cn",changeOrigin:!0,secure:!1,pathRewrite:{"^/auth":""},onProxyRes:function(e){e.headers["Access-Control-Allow-Origin"]="*",e.headers["Access-Control-Allow-Methods"]="GET,PUT,POST,DELETE,OPTIONS",e.headers["Access-Control-Allow-Headers"]="Content-Type, Authorization",e.headers["Access-Control-Allow-Credentials"]="true"}}},W=V,z=[{path:"/",routes:[{path:"/test/index",name:"\u6D4B\u8BD5\u9875\u9762",component:"@/pages/test/index"},{path:"/Invoicing/index",name:"\u5F00\u7968\u7BA1\u7406",component:"@/pages/Invoicing/index"}]}],G={plugins:["@umijs/plugins/dist/dva"],proxy:W,dva:{},base:"/cloudMenu/",publicPath:"/cloudMenu/",outputPath:"dist",title:"\u9A7F\u5546\u4E91\u5E73\u53F0",favicons:["/favicon.ico"],routes:z,history:{type:"browser"}},U=function(e){var n,s=(0,u.useLocation)(),o=s.pathname,l=e.dispatch,c=e.children,i=e.user,p=i.isLogin,d=i.layoutWrapperLoading,y=i.indexValidMenuItemByPath,P=(n=y[o])===null||n===void 0?void 0:n.label,I=G.title,E=P?"".concat(P," - ").concat(I):I;(0,g.useEffect)(function(){l==null||l({type:"user/getUserInfoAuthorityMenu",payload:{type:"relay"}})},[l]);var h=(0,a.jsx)(N.Z,{size:"large",style:{width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"}});return d||(p?o!=="/user/login"&&(h=c):h=(0,a.jsx)("div",{})),(0,a.jsxs)(g.Fragment,{children:[(0,a.jsx)(u.Helmet,{children:(0,a.jsx)("title",{children:E})}),h]})},$=(0,u.connect)(function(r){var e=r.user;return{user:e}})(U),Y=function(){return(0,a.jsx)(B.ZP,{title:"404",status:"404",subTitle:"\u5BF9\u4E0D\u8D77, \u60A8\u8BBF\u95EE\u7684\u9875\u9762\u4E0D\u5B58\u5728",extra:(0,a.jsx)(L.ZP,{type:"primary",onClick:function(){return u.history.push("/")},children:"\u8FD4\u56DE\u9996\u9875"})})},J=Y,Q=t(64599),X=t.n(Q),k=function r(e,n){var s=[],o=X()(e),l;try{for(o.s();!(l=o.n()).done;){var c=l.value;c.hideInMenu||(c.children?s.push(f()(f()({},c),{},{children:r(c.children,n)})):s.push(n(c)))}}catch(i){o.e(i)}finally{o.f()}return s},w=k,q=t(60199),ue=A.Z.Header,_=A.Z.Content,oe=Z.Z.TabPane,ie=function(e){if(!e.length)return[""];if(e.length===1)return e.map(function(o){return"".concat(o.key)});for(var n=[],s=0;s<e.length-1;s++)n.push("".concat(e[s].key));return n},ee=function(e){var n=(0,g.useState)(!1),s=C()(n,2),o=s[0],l=s[1],c=(0,u.useLocation)(),i=c.pathname;console.log("pathname",i);var p=e.dispatch,d=e.user,y=d.menu,P=d.rootSubmenuKeys,I=d.indexAllMenuItemById,E=d.indexValidMenuItemByPath,h=e.global.tabsRoutes,m=E[i],ae=(0,g.useState)((m==null?void 0:m.path)||"/"),b=C()(ae,2),le=b[0],ne=b[1],ce=w(y,function(v){return f()(f()({},v),{},{name:v.path?(0,a.jsx)(u.Link,{to:v.path,style:{color:i===v.path?"#1890ff":"inherit"},className:i===v.path?"ant-menu-item-selected":"",children:v.name}):v.name})}),de=(0,u.useLocation)(),he=function(x){p({type:"global/changeTabsRoutes",payload:{data:x,action:"add"}})},ve=function(x,D){if(D==="remove"&&p){var j=h.findIndex(function(re){return re.path===x}),S=h[j+1]?h[j+1].path:h[j-1]?h[j-1].path:"";u.history.push(S||"/"),ne(S),p({type:"global/changeTabsRoutes",payload:{data:[x],action:D}})}},pe=[{SYSTEMMODULE_DESC:"",guid:"1",hideInMenu:!1,name:"\u6D4B\u8BD5",path:"/test/index"}];return(0,a.jsx)($,{children:(0,a.jsx)(q.f,{menuRender:!1,children:(0,a.jsx)(A.Z,{children:(0,a.jsx)(_,{children:m?(0,a.jsx)(K,{children:(0,a.jsx)(u.Outlet,{})}):(0,a.jsx)(J,{})})})})})},te=(0,u.connect)(function(r){var e=r.user,n=r.global;return{user:e,global:n}})(ee)}}]);
