判断用户身份
This commit is contained in:
parent
ae7b0761f4
commit
8d1c2e17f2
|
|
@ -18,6 +18,6 @@
|
|||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
<script src="./umi.400da1f7.js"></script>
|
||||
<script src="./umi.4eb8b115.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[4],{H4Hi:function(e,t,a){e.exports={siderBar:"siderBar___3a9iE",siderHead:"siderHead___2E1rr","ant-menu":"ant-menu___2FcvC"}},tCqT:function(e,t,a){"use strict";a.r(t);a("Pwec");var n=a("CtXQ"),c=a("9og8"),l=a("tJVT"),r=a("rAM+"),i=(a("lUTK"),a("BvKs")),s=a("WmNS"),o=a.n(s),m=a("q1tI"),u=a.n(m),p=(a("XDpg"),a("xrsn")),d=a.n(p),h=e=>{var t=e.backUrl;return u.a.createElement("div",{className:"admin-header"},u.a.createElement("div",{onClick:()=>{window.location.href=t}},u.a.createElement(n["a"],{className:d.a.backHome,type:"home"}),u.a.createElement("span",null,"\u8fd4\u56de\u4e3b\u7ad9")))},f=a("MuoO"),g=[{title:"GLCC2023",path:"/glcc/2023",name:"GLCC2023",icon:"mail",routes:[{title:"\u914d\u7f6e",path:"/glcc/2023/setting",name:"setting",component:"./glcc/setting"},{title:"\u9879\u76ee\u62a5\u540d\u5217\u8868",path:"/glcc/2023/list",name:"glccList",component:"./glcc/list"},{title:"\u5b66\u751f\u62a5\u540d\u5217\u8868",path:"/glcc/2023/studentList",name:"studentList",component:"./glcc/studentList"}]},{title:"GLCC2022",path:"/glcc/2022",name:"GLCC2022",icon:"mail",routes:[{title:"\u9879\u76ee\u62a5\u540d\u5217\u8868",path:"/glcc/2022/list",name:"glccList",component:"./glcc/list"},{title:"\u5b66\u751f\u62a5\u540d\u5217\u8868",path:"/glcc/2022/studentList",name:"studentList",component:"./glcc/studentList"},{title:"\u4e2d\u671f\u8003\u6838\u6750\u6599",path:"/glcc/2022/middle",name:"middleList",component:"./glcc/middleTaskList"},{title:"\u7ed3\u9879\u8003\u6838\u6750\u6599",path:"/glcc/2022/final",name:"finalList",component:"./glcc/finalList"},{title:"\u5bfc\u5e08\u8bc4\u5206\u5217\u8868",path:"/glcc/2022/final/tutor",name:"tutorList",component:"./glcc/tutorFinalList"}]}],v=a("H4Hi"),b=a.n(v),w=a("Xe+6"),y=i["a"].SubMenu,E=e=>{var t=e.history,a=e.children,s=(e.dispatch,e.siteInfo),p=!1,d=[],f=t.location.pathname||"/global";if(window.innerWidth>600){var v,E=Object(r["a"])(g);try{for(E.s();!(v=E.n()).done;){var L,O=v.value,C=Object(r["a"])(O.routes);try{for(C.s();!(L=C.n()).done;){var k=L.value;f.indexOf(k.path)>-1&&d.push(O.name)}}catch(K){C.e(K)}finally{C.f()}}}catch(K){E.e(K)}finally{E.f()}}else p=!0;var _=Object(m["useState"])([f]),j=Object(l["a"])(_,2),H=j[0],x=j[1],I=Object(m["useState"])(p),G=Object(l["a"])(I,2),N=G[0],U=G[1];Object(m["useEffect"])((()=>{function e(){return t.apply(this,arguments)}function t(){return t=Object(c["a"])(o.a.mark((function e(){return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(w["a"])({url:"/api/user/getUserInfo",method:"get"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),t.apply(this,arguments)}e().then((e=>{e&&!e.admin&&"8000"!==window.location.port&&(window.location.href="https://testforgeplus.trustie.net/403")}))}),[]),Object(m["useEffect"])((()=>{var e,a=[],n=Object(r["a"])(g);try{for(n.s();!(e=n.n()).done;){var c=e.value;if(Array.isArray(c.routes)){var l,i=Object(r["a"])(c.routes);try{for(i.s();!(l=i.n()).done;){var s=l.value;a.push(s.path)}}catch(K){i.e(K)}finally{i.f()}}}}catch(K){n.e(K)}finally{n.f()}t.listen((e=>{a.includes(e.pathname)&&(console.log(e.pathname),x([e.pathname]))}))}),[t]);if(Array.isArray(s)){var A,S=Object(r["a"])(s);try{for(S.s();!(A=S.n()).done;){var B=A.value;"site"===B.name&&B.url}}catch(K){S.e(K)}finally{S.f()}}return u.a.createElement(u.a.Fragment,null,u.a.createElement("div",{className:b.a.siderBar},u.a.createElement("div",{className:b.a.siderHead,onClick:()=>{U(!N)}},N?u.a.createElement(n["a"],{type:"menu-fold"}):u.a.createElement("h3",null,"GLCC\u7ba1\u7406\u540e\u53f0")),u.a.createElement(i["a"],{selectedKeys:H,defaultOpenKeys:d,mode:"inline",theme:"dark",inlineCollapsed:N},g.map((e=>u.a.createElement(y,{key:e.name,title:u.a.createElement("span",null,u.a.createElement(n["a"],{type:e.icon}),u.a.createElement("span",null,e.title))},e.routes&&e.routes.map((e=>u.a.createElement(i["a"].Item,{key:e.path,onClick:()=>{t.push(e.path),x([e.path])}},e.title)))))))),u.a.createElement("div",{className:"main"},u.a.createElement(h,{backUrl:window.location.href.indexOf("test")>-1?"https://testforgeplus.trustie.net/admins":"https://www.gitlink.org.cn/admins"}),a))};t["default"]=Object(f["connect"])((e=>{var t=e.user,a=e.setting;return{currentUser:t.currentUser,siteInfo:a.menuSetting.siteInfo}}))(E)},xrsn:function(e,t,a){e.exports={backHome:"backHome___2HrP2",headImg:"headImg___3leGw"}}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[4],{H4Hi:function(e,t,a){e.exports={siderBar:"siderBar___3a9iE",siderHead:"siderHead___2E1rr","ant-menu":"ant-menu___2FcvC"}},tCqT:function(e,t,a){"use strict";a.r(t);a("Pwec");var n=a("CtXQ"),c=a("9og8"),l=a("tJVT"),r=a("rAM+"),i=(a("lUTK"),a("BvKs")),s=a("WmNS"),o=a.n(s),m=a("q1tI"),u=a.n(m),p=(a("XDpg"),a("xrsn")),d=a.n(p),h=e=>{var t=e.backUrl;return u.a.createElement("div",{className:"admin-header"},u.a.createElement("div",{onClick:()=>{window.location.href=t}},u.a.createElement(n["a"],{className:d.a.backHome,type:"home"}),u.a.createElement("span",null,"\u8fd4\u56de\u4e3b\u7ad9")))},f=a("MuoO"),g=[{title:"GLCC2023",path:"/glcc/2023",name:"GLCC2023",icon:"mail",routes:[{title:"\u914d\u7f6e",path:"/glcc/2023/setting",name:"setting",component:"./glcc/setting"},{title:"\u9879\u76ee\u62a5\u540d\u5217\u8868",path:"/glcc/2023/list",name:"glccList",component:"./glcc/list"},{title:"\u5b66\u751f\u62a5\u540d\u5217\u8868",path:"/glcc/2023/studentList",name:"studentList",component:"./glcc/studentList"}]},{title:"GLCC2022",path:"/glcc/2022",name:"GLCC2022",icon:"mail",routes:[{title:"\u9879\u76ee\u62a5\u540d\u5217\u8868",path:"/glcc/2022/list",name:"glccList",component:"./glcc/list"},{title:"\u5b66\u751f\u62a5\u540d\u5217\u8868",path:"/glcc/2022/studentList",name:"studentList",component:"./glcc/studentList"},{title:"\u4e2d\u671f\u8003\u6838\u6750\u6599",path:"/glcc/2022/middle",name:"middleList",component:"./glcc/middleTaskList"},{title:"\u7ed3\u9879\u8003\u6838\u6750\u6599",path:"/glcc/2022/final",name:"finalList",component:"./glcc/finalList"},{title:"\u5bfc\u5e08\u8bc4\u5206\u5217\u8868",path:"/glcc/2022/final/tutor",name:"tutorList",component:"./glcc/tutorFinalList"}]}],v=a("H4Hi"),b=a.n(v),w=a("Xe+6"),y=i["a"].SubMenu,E=e=>{var t=e.history,a=e.children,s=(e.dispatch,e.siteInfo),p=!1,d=[],f=t.location.pathname||"/global";if(window.innerWidth>600){var v,E=Object(r["a"])(g);try{for(E.s();!(v=E.n()).done;){var L,O=v.value,C=Object(r["a"])(O.routes);try{for(C.s();!(L=C.n()).done;){var k=L.value;f.indexOf(k.path)>-1&&d.push(O.name)}}catch(K){C.e(K)}finally{C.f()}}}catch(K){E.e(K)}finally{E.f()}}else p=!0;var _=Object(m["useState"])([f]),j=Object(l["a"])(_,2),H=j[0],x=j[1],I=Object(m["useState"])(p),G=Object(l["a"])(I,2),N=G[0],U=G[1];Object(m["useEffect"])((()=>{function e(){return t.apply(this,arguments)}function t(){return t=Object(c["a"])(o.a.mark((function e(){return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(w["a"])({url:"/api/user/getUserInfo",method:"get"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),t.apply(this,arguments)}e().then((e=>{e&&e.data&&!e.data.admin&&"8000"!==window.location.port&&(window.location.href="https://testforgeplus.trustie.net/403")}))}),[]),Object(m["useEffect"])((()=>{var e,a=[],n=Object(r["a"])(g);try{for(n.s();!(e=n.n()).done;){var c=e.value;if(Array.isArray(c.routes)){var l,i=Object(r["a"])(c.routes);try{for(i.s();!(l=i.n()).done;){var s=l.value;a.push(s.path)}}catch(K){i.e(K)}finally{i.f()}}}}catch(K){n.e(K)}finally{n.f()}t.listen((e=>{a.includes(e.pathname)&&(console.log(e.pathname),x([e.pathname]))}))}),[t]);if(Array.isArray(s)){var A,S=Object(r["a"])(s);try{for(S.s();!(A=S.n()).done;){var B=A.value;"site"===B.name&&B.url}}catch(K){S.e(K)}finally{S.f()}}return u.a.createElement(u.a.Fragment,null,u.a.createElement("div",{className:b.a.siderBar},u.a.createElement("div",{className:b.a.siderHead,onClick:()=>{U(!N)}},N?u.a.createElement(n["a"],{type:"menu-fold"}):u.a.createElement("h3",null,"GLCC\u7ba1\u7406\u540e\u53f0")),u.a.createElement(i["a"],{selectedKeys:H,defaultOpenKeys:d,mode:"inline",theme:"dark",inlineCollapsed:N},g.map((e=>u.a.createElement(y,{key:e.name,title:u.a.createElement("span",null,u.a.createElement(n["a"],{type:e.icon}),u.a.createElement("span",null,e.title))},e.routes&&e.routes.map((e=>u.a.createElement(i["a"].Item,{key:e.path,onClick:()=>{t.push(e.path),x([e.path])}},e.title)))))))),u.a.createElement("div",{className:"main"},u.a.createElement(h,{backUrl:window.location.href.indexOf("test")>-1?"https://testforgeplus.trustie.net/admins":"https://www.gitlink.org.cn/admins"}),a))};t["default"]=Object(f["connect"])((e=>{var t=e.user,a=e.setting;return{currentUser:t.currentUser,siteInfo:a.menuSetting.siteInfo}}))(E)},xrsn:function(e,t,a){e.exports={backHome:"backHome___2HrP2",headImg:"headImg___3leGw"}}}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue