2 lines
1.4 KiB
JavaScript
2 lines
1.4 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-08597186"],{"424d":function(t,o,s){},"8a49":function(t,o,s){"use strict";s("424d")},9529:function(t,o,s){"use strict";s.r(o);var n=function(){var t=this,o=t._self._c;return o("div",[o("span",[t._v(t._s(t.ssoInfo.errMsg))]),o("init-data",{ref:"initData"})],1)},e=[],r=s("9a15"),i=s("b775");function a(t){return new Promise((o,s)=>{Object(i["a"])({url:"/login.ssoTokenLogin",method:"post",data:t,headers:{"Content-Type":"application/json"}}).then(t=>{const s=t.data;o(s)}).catch(t=>{s(t)})})}var c=s("7323"),h={name:"SsoPage",components:{initData:r["a"]},data(){return{ssoInfo:{errMsg:"",shopId:""}}},created(){this.initMethod()},methods:{initMethod(){const t=this.$route.query.token;if(!t)return void(this.ssoInfo.errMsg=this.$t("sso.noTokenError"));const o=this.$route.query.targetUrl;this.ssoInfo.shopId=this.$route.query.shopId||Object(c["f"])(),o?this.authLogin(t,o):this.ssoInfo.errMsg=this.$t("sso.noTargetUrlError")},async authLogin(t,o){try{const s={hcAccessToken:t},n=await a(s);if(0!=n.code)return void(this.ssoInfo.errMsg=n.msg);localStorage.setItem("token",n.token),this.$refs.initData.loadShopInfo({url:decodeURIComponent(o),shopId:this.ssoInfo.shopId})}catch(s){console.error("SSO登录失败:",s)}}}},d=h,u=(s("8a49"),s("2877")),f=Object(u["a"])(d,n,e,!1,null,"69adf4c2",null);o["default"]=f.exports}}]);
|
|
//# sourceMappingURL=chunk-08597186.72ed1c42.js.map
|