(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[15],{"2cdc":function(e,i,c){"use strict";c("5087d")},"5087d":function(e,i,c){},fa35:function(e,i,c){"use strict";c.r(i);var s=function(){var e=this;e._self._c;return e._m(0)},t=[function(){var e=this,i=e._self._c;return i("div",{staticClass:"loading"},[i("div",{staticClass:"juhua-loading"},[i("div",{staticClass:"jh-circle1 jh-circle-ios"}),i("div",{staticClass:"jh-circle2 jh-circle-ios"}),i("div",{staticClass:"jh-circle3 jh-circle-ios"}),i("div",{staticClass:"jh-circle4 jh-circle-ios"}),i("div",{staticClass:"jh-circle5 jh-circle-ios"}),i("div",{staticClass:"jh-circle6 jh-circle-ios"}),i("div",{staticClass:"jh-circle7 jh-circle-ios"}),i("div",{staticClass:"jh-circle8 jh-circle-ios"}),i("div",{staticClass:"jh-circle9 jh-circle-ios"}),i("div",{staticClass:"jh-circle10 jh-circle-ios"}),i("div",{staticClass:"jh-circle11 jh-circle-ios"}),i("div",{staticClass:"jh-circle12 jh-circle-ios"})])])}],a=(c("99af"),c("14d9"),c("d3b7"),c("e6cf"),c("a79d"),c("64f6")),n=c("cce4"),o={name:"huawei",mounted:function(){this.goHuaweiLogin()},methods:{goHuaweiLogin:function(){var e=this,i="".concat("http://172.18.142.212:31520/","v1/extend-login/hw_iot_stage?clientId=").concat("huawei_iot_stage_tv_screen","&callback=").concat("http://172.18.142.212:3002/hwauth/?type=dashboard","&scope=server"),c=cordova.InAppBrowser.open(i,"_blank","location=no");c.addEventListener("message",(function(i){var s=i.data,t=s.code,a=s.refresh;t?e.authByCode(t,c):a?e.goHuaweiLogin():(c.close(),e.$router.push("/login/password"))})),c.addEventListener("loadstop",(function(){c.executeScript({code:'(function() {\n              window.addEventListener(\'huawei_login\', function(event){\n                var refresh = event.detail.refresh;\n                var code = event.detail.code;\n                var message;\n                if (code) {\n                  message = {"code": event.detail.code};\n                } else if (refresh) {\n                  message = {"refresh": event.detail.refresh};\n                }\n                webkit.messageHandlers.cordova_iab.postMessage(JSON.stringify(message));\n              });\n            })();'})}))},authByCode:function(e,i){var c=this;this.$q.loading.show(),e&&Object(a["a"])(e).then((function(e){i.close();var s="bearer "+e.access_token,t="bearer "+e.refresh_token;Object(n["i"])(s),Object(n["h"])(t),c.$router.push("/main/home")})).catch((function(){i.close(),alert("登录失败，请重新登录")})).finally((function(){c.$q.loading.hide()}))}}},r=o,l=(c("2cdc"),c("2877")),d=Object(l["a"])(r,s,t,!1,null,"d83bddf0",null);i["default"]=d.exports}}]);