text: (window.webpackJsonp=window.webpackJsonp||[]).push([[27],{WArq:function(l,o,e){l.exports={main:"main___27u_p",header:"header___3U2NK",title:"title___2-qf2",desc:"desc___1T5Y7",placeholder:"placeholder___3JTaE",qrcodeContainer:"qrcodeContainer___1_HhP"}},XPzc:function(l,o,e){"use strict";e.r(o);var S=e("J+/v"),D=e("MoRW"),y=e("T2oS"),P=e("W9HT"),j=e("fOrg"),f=e("+KLJ"),w=e("miYZ"),d=e("tsqr"),r=e("tJVT"),_=e("cDcd"),a=e.n(_),h=e("WArq"),s=e.n(h),v=e("895H"),g=e("N18V"),C=e("fmxG"),A=e.n(C),i=e("/MpO"),L=e("RICU"),T=function(){var p=Object(_.useState)(),E=Object(r.a)(p,2),u=E[0],B=E[1],W=Object(_.useState)(),m=Object(r.a)(W,2),R=m[0],U=m[1],I=Object(_.useState)("loading"),O=Object(r.a)(I,2),M=O[0],c=O[1],K=function(){var F=new URLSearchParams(window.location.search).get("redirect")||window.location.href.replace(window.location.pathname,"/staff-admin/welcome");c("loading"),Object(i.b)("",F).then(function(t){if(t.code!==0){B(t.message),U(t.code),c("failed");return}var n=t.data;console.log("params",n),window.WwLogin({id:"qrcodeContainer",appid:n.app_id,agentid:n.agent_id,redirect_uri:n.redirect_uri,state:n.state,href:"https://openscrm.oss-cn-hangzhou.aliyuncs.com/public/qrcode.css"}),c("success")}).catch(function(t){console.log(t)}),window.location.href.includes("dashboard.demo.openscrm.cn")&&(d.default.info("\u6F14\u793A\u73AF\u5883\u65E0\u9700\u626B\u7801\u767B\u5F55\uFF0C3\u79D2\u540E\u81EA\u52A8\u767B\u5F55",3e3),setTimeout(function(){Object(i.c)().then(function(t){if(t.code!==0){d.default.error(t.message);return}window.location.href="http://dashboard.demo.openscrm.cn:8000/staff-admin/welcome"}).catch(function(t){d.default.error("\u81EA\u52A8\u767B\u5F55\u5931\u8D25"),console.log("err",t)})},3e3))};return a.a.createElement("div",{className:s.a.main},a.a.createElement("div",{className:s.a.header},a.a.createElement(v.a,{level:1,className:s.a.title,style:{fontWeight:500,fontSize:"28px",marginBottom:"8px"}},"\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u767B\u5F55"),a.a.createElement(g.a,{className:s.a.desc},"\u5B89\u5168\uFF0C\u5F3A\u5927\uFF0C\u6613\u5F00\u53D1\u7684\u5F00\u6E90\u4F01\u4E1A\u5FAE\u4FE1SCRM")),R!==L.a&&u&&a.a.createElement(f.a,{style:{marginTop:12},message:u,type:"error",showIcon:!0}),M==="loading"&&a.a.createElement("div",{className:s.a.placeholder},a.a.createElement(P.a,{size:"large"})),M==="failed"&&a.a.createElement("div",{className:s.a.placeholder},a.a.createElement(D.a,{status:"warning",title:"\u7CFB\u7EDF\u9519\u8BEF",subTitle:"\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"})),a.a.createElement("div",{id:"qrcodeContainer",className:s.a.qrcodeContainer},a.a.createElement(A.a,{type:"text/javascript",src:"https://rescdn.qqmail.com/node/ww/wwopenmng/js/sso/wwLogin-1.0.0.js",onLoad:K})))};o.default=T}}]);
  