{"version":3,"sources":["webpack:///./src/views/login/index.vue?8ff8","webpack:///./src/views/login/index.vue","webpack:///./src/views/login/index.vue?7082"],"names":["_hoisted_1","class","_hoisted_2","__name","__props","document","title","store","envStore","isLogin","getters","router","route","enableClick","val","replace","path","query","goAuth","push","goHelp","location","assign","login","async","url","URL","href","scope","searchParams","get","dispatch","forceLogin","authorize","isInPC","window","native","CallNativeFunction","status","userID","console","log","isInMac","WebViewJavascriptBridge","callHandler","err","userInfo","message","userId","listenerId","addEventListener","event","state","removeEventListener","sso","signIn","_ctx","_cache","onClick","args","__exports__"],"mappings":"2IAAA,W,mMCMA,MAAMA,EAAa,CACjBC,MAAO,SAEHC,EAA0B,gCAAoB,IAAK,KAAM,mBAAoB,GAUvD,mCAAiB,CAC3CC,OAAQ,QACR,MAAMC,GACJC,SAASC,MAAQ,KACjB,MAAMC,EAAQ,iBACRC,EAAW,iBACXC,EAAU,sBAAS,IAChBF,EAAMG,QAAQD,SAEjBE,EAAS,iBACTC,EAAQ,kBACR,YACJC,GACE,iBACJ,mBAAMJ,EAASK,IACTA,GACFH,EAAOI,QAAQ,CACbC,KAAM,QACNC,MAAOL,EAAMK,UAInB,MAAMC,EAAS,KACbP,EAAOQ,KAAK,CACVH,KAAM,cACNC,MAAOL,EAAMK,SAGXG,EAAS,KACbC,SAASC,OAAO,SAEZC,EAAQC,UACZ,MAAMC,EAAM,IAAIC,IAAIL,SAASM,MACvBC,EAAQH,EAAII,aAAaC,IAAI,SAC/BF,GACF,eAAc,QAASA,GAGzB,MAAMnB,QAAgBF,EAAMwB,SAAS,QAAS,CAC5CC,WAAY,IAEVvB,GACEG,EAAMK,MAAMgB,WAAuC,WAA1BrB,EAAMK,MAAMgB,WACvCf,KAoCN,OAhCA,uBAAU,KACJV,EAAS0B,QACXC,OAAOC,OAAOC,mBAAmB,YAAab,MAAOc,EAAQC,KAC3DC,QAAQC,IAAI,kBAAmBF,GAChB,MAAXA,SACIhB,MAIRf,EAASkC,SACXP,OAAOQ,wBAAwBC,YAAY,eAAepB,eAAgBqB,EAAKC,GAC7E,GAAID,EACFL,QAAQC,IAAII,EAAIE,cAGhB,GADAP,QAAQC,IAAI,eAAgBK,GACJ,MAApBA,EAASE,aACLzB,QACD,CACLiB,QAAQC,IAAI,UAEZ,MAAMQ,EAAad,OAAOQ,wBAAwBO,iBAAiB,cAAc1B,eAAgB2B,GAC/FX,QAAQC,IAAI,YAAaU,GACL,IAAhBA,EAAMC,QACRjB,OAAOQ,wBAAwBU,oBAAoB,aAAcJ,SAC3DK,EAAA,KAAIC,mBAQjB,CAACC,EAAMC,KACL,yBAAc,gCAAoB,MAAOzD,EAAY,CAAC,gCAAoB,MAAO,CACtFC,MAAO,aACPyD,QAASD,EAAO,KAAOA,EAAO,GAE9B,IAAIE,IAAS,mBAAO9C,IAAgB,mBAAOA,EAAP,IAAuB8C,MACzDzD,EAAY,gCAAoB,OAAQ,CAC1CD,MAAO,eACPyD,QAASnC,GACR,QAAS,gCAAoB,MAAO,CACrCtB,MAAO,UACPyD,QAAStC,GACR,mB,UCzGT,MAAMwC,EAAc,EAEL,gB","file":"js/chunk-641e493c.js","sourcesContent":["/* unplugin-vue-components disabled */export * from \"-!../../../../../node_modules/.pnpm/unplugin@1.4.0/node_modules/unplugin/dist/webpack/loaders/transform.js?unpluginName=unplugin-vue-components!../../../../../node_modules/.pnpm/mini-css-extract-plugin@0.9.0_webpack@4.46.0/node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/.pnpm/css-loader@3.6.0_webpack@4.46.0/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/.pnpm/vue-loader@16.8.3_@vue+compiler-sfc@3.3.4_vue@3.3.4_webpack@4.46.0/node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/.pnpm/postcss-loader@3.0.0/node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/.pnpm/sass-loader@8.0.2_sass@1.65.1/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/.pnpm/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/.pnpm/vue-loader@16.8.3_@vue+compiler-sfc@3.3.4_vue@3.3.4_webpack@4.46.0/node_modules/vue-loader/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=e005e54c&lang=scss\"","import \"core-js/modules/es.array.push.js\";\nimport \"core-js/modules/web.url-search-params.delete.js\";\nimport \"core-js/modules/web.url-search-params.has.js\";\nimport \"core-js/modules/web.url-search-params.size.js\";\nimport { defineComponent as _defineComponent } from 'vue';\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\";\nconst _hoisted_1 = {\n class: \"login\"\n};\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"p\", null, \"登录迅雷帐号后,可管理下载任务\", -1);\nimport { computed, onMounted, watch } from 'vue';\nimport '@remote/assets/css/login.scss';\nimport { useStore } from 'vuex';\nimport { LOGIN_FEEDBACK_URL } from '@remote/constant/index';\nimport { useRouter, useRoute } from 'vue-router';\nimport { useVConsole } from '@remote/composable/vconsole';\nimport { useEnvStore } from '@remote/store/env';\nimport sso from '@remote/utils/sso';\nimport { setLocalValue } from '@remote/utils';\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n document.title = '登录';\n const store = useStore();\n const envStore = useEnvStore();\n const isLogin = computed(() => {\n return store.getters.isLogin;\n });\n const router = useRouter();\n const route = useRoute();\n const {\n enableClick\n } = useVConsole();\n watch(isLogin, val => {\n if (val) {\n router.replace({\n path: '/home',\n query: route.query\n });\n }\n });\n const goAuth = () => {\n router.push({\n path: '/authorize/',\n query: route.query\n });\n };\n const goHelp = () => {\n location.assign(LOGIN_FEEDBACK_URL);\n };\n const login = async () => {\n const url = new URL(location.href);\n const scope = url.searchParams.get('scope');\n if (scope) {\n setLocalValue('scope', scope);\n }\n // 正常的登录流程\n const isLogin = await store.dispatch('login', {\n forceLogin: 1\n });\n if (isLogin) {\n if (route.query.authorize && route.query.authorize === 'signin') {\n goAuth();\n }\n }\n };\n onMounted(() => {\n if (envStore.isInPC) {\n window.native.CallNativeFunction('GetUserID', async (status, userID) => {\n console.log('客户端登录态: userid:', userID);\n if (userID !== '0') {\n await login();\n }\n });\n }\n if (envStore.isInMac) {\n window.WebViewJavascriptBridge.callHandler('getUserInfo', async function (err, userInfo) {\n if (err) {\n console.log(err.message);\n } else {\n console.log('mac userinfo', userInfo);\n if (userInfo.userId !== '0') {\n await login();\n } else {\n console.log('监听登录事件');\n // event.state == 0 代表登出成功; event.state == 2 代表登入成功\n const listenerId = window.WebViewJavascriptBridge.addEventListener('userChange', async function (event) {\n console.log('收到客户端登录事件', event);\n if (event.state === 2) {\n window.WebViewJavascriptBridge.removeEventListener('userChange', listenerId);\n await sso.signIn();\n }\n });\n }\n }\n });\n }\n });\n return (_ctx, _cache) => {\n return _openBlock(), _createElementBlock(\"div\", _hoisted_1, [_createElementVNode(\"div\", {\n class: \"login__img\",\n onClick: _cache[0] || (_cache[0] =\n //@ts-ignore\n (...args) => _unref(enableClick) && _unref(enableClick)(...args))\n }), _hoisted_2, _createElementVNode(\"span\", {\n class: \"button-login\",\n onClick: login\n }, \"立即登录\"), _createElementVNode(\"div\", {\n class: \"go-help\",\n onClick: goHelp\n }, \" 登录遇到问题? \")]);\n };\n }\n});","/* unplugin-vue-components disabled */import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=e005e54c&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__"],"sourceRoot":""}