1 Star 0 Fork 0

阿炸克斯/approval-data-admin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
layouts__main.async.js 8.85 KB
一键复制 编辑 原始数据 按行查看 历史
GitHub Action 提交于 2024-11-04 03:32 . update
(self.webpackChunk=self.webpackChunk||[]).push([[490],{3219:function(n,d,t){"use strict";t.d(d,{PO:function(){return a},Zr:function(){return u},kK:function(){return i}});var u="token",i="OSS_ENV",a="/",m={SMS:{id:"sms",label:"\u624B\u673A\u77ED\u4FE1"},EMAIL:{id:"email",label:"\u90AE\u7BB1"}}},55437:function(n,d,t){"use strict";t.r(d),t.d(d,{default:function(){return $}});var u=t(93236),i={mainLayout:"mainLayout___BjBuE",header:"header___J7pwG",left:"left___Cf5FN",menuContainer:"menuContainer___kMZz4",operate:"operate___wVEtR",menuList:"menuList___VsDAq",content:"content___EiYnX"},a=t(54306),m=t.n(a),p=t(16112),x=t(245),j=t(78990),A=t(65908),T=t(57002),K=t(27988),P={routes:[{path:"/login",component:"login"},{path:"/",component:"@/layouts/main",routes:[{path:"/home",title:"\u9996\u9875",component:"home"},{path:"/news",title:"\u65B0\u95FB",component:"news"},{path:"/gov",title:"\u6CBB\u7406\u4E13\u9898",component:"gov"},{path:"/qa",title:"\u54A8\u8BE2",component:"qa"},{path:"/guide",title:"\u4E1A\u52A1\u6307\u5357",component:"guide"},{path:"/guide/create",title:"\u4E1A\u52A1\u6307\u5357-\u521B\u5EFA",component:"guide/form",menuHide:!0},{path:"/guide/update/:id",title:"\u4E1A\u52A1\u6307\u5357-\u4FEE\u6539",component:"guide/form",menuHide:!0}]},{path:"*",component:"404"}]},R=P,c=t(62086),F=R.routes;function U(g){var v=[];function y(h,N){N.forEach(function(C){if(!C.menuHide){var D=C.icon,E={label:C.title||"",icon:D?(0,c.jsx)(D,{}):void 0,key:"".concat(C.path)};C.routes&&(E.children=[],y(E.children,C.routes)),h.push(E)}})}return y(v,g),v}function H(){var g,v,y=((g=F.find(function(h){return h.path==="/"&&h.routes}))===null||g===void 0||(v=g.routes)===null||v===void 0?void 0:v.filter(function(h){return h.title}))||[];return U(y)}function k(){var g=location.pathname.split("/").filter(function(y){return y!=="/"&&!!y}),v=[];return g.forEach(function(y){var h=v[v.length-1]||"";v.push("".concat(h,"/").concat(y))}),v}var L={sideBarContainer:"sideBarContainer___AHJoK",logoTitle:"logoTitle___nvO1K",menuList:"menuList___V1R6t",userContainer:"userContainer___hHJ9N",username:"username___TC8Qw"},B=t(3219),Z=H();function b(){var g=(0,u.useState)(function(){return[location.pathname]}),v=m()(g,2),y=v[0],h=v[1],N=(0,u.useState)(function(){return k()}),C=m()(N,2),D=C[0],E=C[1];return(0,u.useEffect)(function(){var r=k();E(r),h(r)},[location.pathname]),(0,c.jsxs)("div",{className:L.sideBarContainer,children:[(0,c.jsx)(K.rU,{to:"/",className:L.logoTitle,children:(0,c.jsx)("span",{className:L.title,children:"\u7BA1\u7406\u7CFB\u7EDF"})}),(0,c.jsx)(x.Z,{mode:"inline",className:L.menuList,items:Z,openKeys:D,selectedKeys:y,onClick:function(s){h([s.key]),K.m8.push(s.key)},onOpenChange:function(s){E(s)}}),(0,c.jsxs)(j.Z,{className:L.userContainer,align:"middle",children:[(0,c.jsx)(A.Z,{value:localStorage.getItem(B.kK)||"test",options:[{label:"\u6D4B\u8BD5",value:"test"},{label:"\u6B63\u5F0F",value:"prod"}],onChange:function(s){localStorage.setItem(B.kK,s),location.reload()}}),(0,c.jsx)("div",{children:(0,c.jsx)(T.ZP,{type:"text",onClick:function(){(0,p.j)(),K.m8.push("/login")},children:"\u9000\u51FA"})})]})]})}function Y(g){var v=g.children;return(0,c.jsxs)("div",{className:i.mainLayout,children:[(0,c.jsx)(b,{}),(0,c.jsx)("div",{className:i.content,children:v})]})}function $(){return(0,c.jsx)(Y,{children:(0,c.jsx)(K.j3,{})})}},16112:function(n,d,t){"use strict";t.d(d,{f:function(){return E},j:function(){return B}});var u=t(3219),i=t(25359),a=t.n(i),m=t(49811),p=t.n(m),x=t(21140),j=t.n(x),A=t(63466),T=t.n(A),K=t(51224),P=t(73669),R=t(27988),c=P.Z.create({baseURL:"/"}),F=["/login"].map(function(r){return"/".concat(r)});c.interceptors.request.use(function(r){var s=localStorage.getItem(u.Zr);return s&&r.headers.set("token",s),r}),c.interceptors.response.use(function(r){return Promise.resolve(r)},function(r){var s=r.response||{},e=s.config||{},l=s.data||{};return l.statusCode!==200&&(e.ignoreNotice||K.t6.error({message:l.message}),!e.ignoreLogin&&l.statusCode===401&&!F.includes(R.m8.location.pathname)&&R.m8.push("/login")),Promise.reject(r)});var U=function(){function r(){j()(this,r)}return T()(r,[{key:"get",value:function(e,l){return c.get(e,l)}},{key:"post",value:function(e,l,o){return c.post(e,l,o)}},{key:"put",value:function(e,l,o){return c.put(e,l,o)}},{key:"delete",value:function(e,l){return c.delete(e,l)}}]),r}();function H(r){return k.apply(this,arguments)}function k(){return k=_asyncToGenerator(_regeneratorRuntime().mark(function r(s){var e;return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,s();case 3:return e=o.sent,o.abrupt("return",[null,e]);case 7:return o.prev=7,o.t0=o.catch(0),o.abrupt("return",[o.t0,null]);case 10:case"end":return o.stop()}},r,null,[[0,7]])})),k.apply(this,arguments)}var L=new U,B=function(){return L.post("".concat(u.PO,"/outlogin")).then(function(){localStorage.removeItem(u.Zr)})},Z=t(52510),b=t.n(Z),Y=t(21156),$=t.n(Y),g=t(67006),v=t.n(g),y=t(37516),h=t(62086),N=localStorage.getItem(u.kK)||"test",C="".concat(N,"/wxa"),D=function(){function r(){j()(this,r),b()(this,"client",void 0),this.init(this.getConfig())}return T()(r,[{key:"init",value:function(e){if(!e){location.pathname.includes("/login")||(window.location.href="/approval-data-admin/login");return}return this.client=new($())(e),this.client}},{key:"validate",value:function(e){var l=this;return new Promise(function(){var o=p()(a()().mark(function O(I,M){var f;return a()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(S.prev=0,f=l.init(e),f){S.next=5;break}return M("client is null"),S.abrupt("return");case 5:return S.next=7,f.put("/___log",new Blob([Date.now().toString()]));case 7:I(null),S.next=14;break;case 10:S.prev=10,S.t0=S.catch(0),console.log("e: ",S.t0),M(S.t0);case 14:case"end":return S.stop()}},O,null,[[0,10]])}));return function(O,I){return o.apply(this,arguments)}}())}},{key:"getConfig",value:function(){var e=localStorage.getItem("accessKeyId"),l=localStorage.getItem("accessKeySecret"),o=localStorage.getItem("region"),O=localStorage.getItem("bucket");if(e)return{accessKeyId:e,accessKeySecret:l,region:o,bucket:O}}},{key:"formatUrl",value:function(e){return e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("/")?C+e:C+"/"+e}},{key:"getData",value:function(e){var l=this.client.signatureUrl(this.formatUrl(e));return L.get(l)}},{key:"updateData",value:function(){var s=p()(a()().mark(function l(o,O){var I;return a()().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return I=new Blob([JSON.stringify(O)]),f.prev=1,f.next=4,this.client.put(this.formatUrl(o),I);case 4:f.next=10;break;case 6:throw f.prev=6,f.t0=f.catch(1),y.ZP.error({content:(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{children:"\u66F4\u65B0\u5931\u8D25"})})}),f.t0;case 10:case"end":return f.stop()}},l,this,[[1,6]])}));function e(l,o){return s.apply(this,arguments)}return e}()},{key:"uploadFile",value:function(){var s=p()(a()().mark(function l(o,O){var I;return a()().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.client.put(this.formatUrl("/files/".concat(O,"/").concat(v()().format("YYYYMMDD"),"/").concat(o.name)),o);case 2:return I=f.sent,I.url.startsWith("http://")&&(I.url=I.url.replace(/^(http:\/\/)/gi,"https://")),f.abrupt("return",I);case 5:case"end":return f.stop()}},l,this)}));function e(l,o){return s.apply(this,arguments)}return e}()}]),r}(),E=new D},25705:function(n){function d(t,u){(u==null||u>t.length)&&(u=t.length);for(var i=0,a=new Array(u);i<u;i++)a[i]=t[i];return a}n.exports=d,n.exports.__esModule=!0,n.exports.default=n.exports},5548:function(n){function d(t){if(Array.isArray(t))return t}n.exports=d,n.exports.__esModule=!0,n.exports.default=n.exports},40790:function(n){function d(t,u){var i=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(i!=null){var a,m,p,x,j=[],A=!0,T=!1;try{if(p=(i=i.call(t)).next,u===0){if(Object(i)!==i)return;A=!1}else for(;!(A=(a=p.call(i)).done)&&(j.push(a.value),j.length!==u);A=!0);}catch(K){T=!0,m=K}finally{try{if(!A&&i.return!=null&&(x=i.return(),Object(x)!==x))return}finally{if(T)throw m}}return j}}n.exports=d,n.exports.__esModule=!0,n.exports.default=n.exports},15324:function(n){function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}n.exports=d,n.exports.__esModule=!0,n.exports.default=n.exports},54306:function(n,d,t){var u=t(5548),i=t(40790),a=t(41442),m=t(15324);function p(x,j){return u(x)||i(x,j)||a(x,j)||m()}n.exports=p,n.exports.__esModule=!0,n.exports.default=n.exports},41442:function(n,d,t){var u=t(25705);function i(a,m){if(a){if(typeof a=="string")return u(a,m);var p=Object.prototype.toString.call(a).slice(8,-1);if(p==="Object"&&a.constructor&&(p=a.constructor.name),p==="Map"||p==="Set")return Array.from(a);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return u(a,m)}}n.exports=i,n.exports.__esModule=!0,n.exports.default=n.exports}}]);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/ajax_lv/approval-data-admin.git
git@gitee.com:ajax_lv/approval-data-admin.git
ajax_lv
approval-data-admin
approval-data-admin
gh-pages

搜索帮助