1 line
138 KiB
JavaScript
1 line
138 KiB
JavaScript
|
"use strict";(self["webpackChunkmining_pool"]=self["webpackChunkmining_pool"]||[]).push([[577],{857:function(e,t,i){Object.defineProperty(t,"B",{value:!0}),t.A=void 0,i(44114);var s=i(47149),n=i(6803),o=i(82908);t.A={computed:{key(){return this.$route.path}},data(){return{isLogin:!1,bthText:"English",token:"",accountList:[],miningAccountList:[],isOrderKey:"",activeIndex2:"",isDropdownVisible:!1,activeIndex:"",jurisdiction:{roleKey:""},ManagementShow:!1,currencyList:[],activeItem:{value:"nexa",label:"nexa",imgUrl:(0,o.getImageUrl)("/img/nexa.png")},customerIsOnline:!1,userEmail:""}},watch:{token:{handler(e){this.isLogin=!!e},immediate:!0,deep:!0},accountList:{handler(e){},immediate:!0,deep:!0},miningAccountList:{handler(e){},immediate:!0,deep:!0},$route(e,t){"/miningAccount"!==e.path&&(this.activeIndex="")},activeItemCoin:{handler(e){this.changeMenuName($event,this.activeItem)},deep:!0}},mounted(){this.$addStorageEvent(1,"activeItemCoin",JSON.stringify(this.activeItem));let e=localStorage.getItem("token");this.token=JSON.parse(e);let t=localStorage.getItem("accountList");this.accountList=JSON.parse(t);let i=localStorage.getItem("miningAccountList");this.miningAccountList=JSON.parse(i);let s=localStorage.getItem("jurisdiction");this.jurisdiction=JSON.parse(s);let n=localStorage.getItem("currencyList");this.currencyList=JSON.parse(n);let o=localStorage.getItem("userEmail");this.userEmail=JSON.parse(o),window.addEventListener("setItem",(()=>{let e=localStorage.getItem("token");this.token=JSON.parse(e);let t=localStorage.getItem("accountList");this.accountList=JSON.parse(t);let i=localStorage.getItem("miningAccountList");this.miningAccountList=JSON.parse(i);let s=localStorage.getItem("jurisdiction");this.jurisdiction=JSON.parse(s);let n=localStorage.getItem("currencyList");this.currencyList=JSON.parse(n);let o=localStorage.getItem("activeItemCoin");this.activeItem=JSON.parse(o);let a=localStorage.getItem("userEmail");this.userEmail=JSON.parse(a),this.jurisdiction&&"admin"==this.jurisdiction.roleKey?this.ManagementShow=!0:this.ManagementShow=!1})),this.jurisdiction&&"admin"==this.jurisdiction.roleKey?this.ManagementShow=!0:this.ManagementShow=!1,document.addEventListener("click",(function(){const e=document.querySelector(".dropdown"),t=document.querySelector(".arrow");try{e.classList.contains("show")&&(e.classList.remove("show"),t.classList.remove("up"))}catch(i){console.log(i)}}))},methods:{toggleDropdown(e){if(!e)return;const t=e.currentTarget,i=t.querySelector(".dropdown"),s=t.querySelector(".arrow");i&&(i.classList.toggle("show"),s?.classList.toggle("up"))},changeMenuName(e,t){if(!e)return;e.stopPropagation();const i=document.getElementById("menu1");if(!i)return;this.activeItem=t;const s=i.querySelector(".dropdown"),n=i.querySelector(".arrow");s?.classList.remove("show"),n?.classList.remove("up"),this.$addStorageEvent(1,"activeItemCoin",JSON.stringify(t))},handelDarkMode(){},async fetchAccountGradeList(){const e=await(0,s.getAccountGradeList)();this.miningAccountList=e.data,this.$addStorageEvent(1,"miningAccountList",JSON.stringify(this.miningAccountList))},async fetchAccountList(e){const t=await(0,n.getAccountList)(e);t&&200==t.code&&(this.accountList=t.data,this.$addStorageEvent(1,"accountList",JSON.stringify(this.accountList)))},async fetchUserid(e){try{const t=await getUserid(e);t&&200==t.code&&(this.customerIsOnline=t.data.customerIsOnline,localStorage.setItem("customerIsOnline",JSON.stringify(this.customerIsOnline)))}catch(t){throw console.error("获取用户ID失败:",t),t}},async fetchSignOut(){const e=await(0,s.getLogout)();if(e&&200==e.code){await this.$store.dispatch("logout");const e=this.$i18n.locale;this.fetchUserid({email:this.userEmail}),this.$router.push(`/${e}`)}},handleDropdownClick(){this.isDropdownVisible=!0},handleCommand(e){},handleSelect(){},handelLogin(){this.isLogin=!0;const e=this.$i18n.locale;this.$router.push(`/${e}/login`)},handelRegister(){const e=this.$i18n.locale;this.$router.push(`/${e}/register`)},handelLogin222(){this.isLogin=!this.isLogin},handelJump(e){try{const t=this.$i18n.locale;if
|