(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/ucenter/login-withapi"],{7542:function(e,n,t){"use strict";(function(e){var i=t("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(t("9523")),u=t("26cb");function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var a={data:function(){return{apiKey:"",needAgreements:!0,focusApiKey:!1,logo:"/static/image/logo.png"}},onShow:function(){},computed:function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?r(Object(t),!0).forEach((function(n){(0,o.default)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({},(0,u.mapState)({utils:function(e){return e.utils}})),methods:{apiLogin:function(){var n=this;if(!this.apiKey.length)return this.focusApiKey=!0,this.showToast("请输入API Key");if(this.needAgreements&&this.$refs.agreements&&!this.$refs.agreements.getAgree())return this.$refs.agreements.popup(this.pwdLogin);var t={apiKey:this.apiKey},i=this;e.showLoading({title:"请求中..."}),e.request({url:getApp().globalData.server+"/api/auth/apikey/verify",method:"POST",data:JSON.stringify(t),success:function(t){if(e.hideLoading(),t=t.data,"000000"===t.status)return i.$store.dispatch("loginWithapi",n.apiKey),i.showNotify("配置成功","success"),void setTimeout((function(){e.switchTab({url:"/pages/chat/session"})}),1e3);var o=t.msg;return o||(o="请求出错!"),i.showNotify(o,"error")},fail:function(n){return e.hideLoading(),i.showNotify("请求出错!","error")}})},pwdLogin:function(){e.navigateTo({url:"/pages/ucenter/login-withpwd"})},tokenLogin:function(){e.navigateTo({url:"/pages/ucenter/login-withtoken"})},howFetch:function(){e.navigateTo({url:"/pages/ucenter/gen-apikey"})},showNotify:function(e,n){this.$refs.uNotify.show({type:n,message:e,duration:3e3,safeAreaInsetTop:!0})},showToast:function(e){this.$refs.uToast.show({message:e,type:"error",duration:2e3,position:"bottom"})}}};n.default=a}).call(this,t("543d")["default"])},"82aa":function(e,n,t){"use strict";(function(e,n){var i=t("4ea4");t("baca"),t("a9ff");i(t("66fd"));var o=i(t("de2c"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t("bc2e")["default"],t("543d")["createPage"])},"96e2":function(e,n,t){},"9d11":function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return u})),t.d(n,"a",(function(){return i}));var i={uniNavBar:function(){return t.e("uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar").then(t.bind(null,"f033"))},uniForms:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-forms/components/uni-forms/uni-forms")]).then(t.bind(null,"7a0e"))},uniFormsItem:function(){return t.e("uni_modules/uni-forms/components/uni-forms-item/uni-forms-item").then(t.bind(null,"5b3b"))},uniEasyinput:function(){return t.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(t.bind(null,"2920"))},uniIdPagesAgreements:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements")]).then(t.bind(null,"202c"))},uNotify:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-notify/u-notify")]).then(t.bind(null,"26f7"))},uToast:function(){return t.e("uni_modules/uview-ui/components/u-toast/u-toast").then(t.bind(null,"c097"))}},o=function(){var e=this,n=e.$createElement;e._self._c;e._isMounted||(e.e0=function(n){return e.$store.state.utils.back()},e.e1=function(n){e.focusApiKey=!1})},u=[]},a7d8:function(e,n,t){"use strict";var i=t("96e2"),o=t.n(i);o.a},abba:function(e,n,t){"use strict";t.r(n);var i=t("7542"),o=t.n(i);for(var u in i)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(u);n["default"]=o.a},de2c:function(e,n,t){"use strict";t.r(n);var i=t("9d11"),o=t("abba");for(var u in o)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(u);t("a7d8");var r=t("f0c5"),a=Object(r["a"])(o["default"],i["b"],i["c"],!1,null,"7923f5fb",null,!1,i["a"],void 0);n["default"]=a.exports}},[["82aa","common/runtime","common/vendor"]]]);