const{createApp}=Vue const{createVuetify,useGoTo,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,showTOC:true,tocPanel:0,tab:'account',post:{discussionId:5043,currentPage:1,targetPage:1,total:9,anchor:0,goToOptions:{container:null,duration:0,easing:'easeInOutCubic',offset:-100,},worker:null,task:[],active:[],apiLock:[],originLike:new Map([]),},related:{block:1,}},search:{width:80,text:null,loading:false,},tags:[{id:37,url:'/t/383344386a045c74677716241d0f',name:'云盘',color:'#66BB6A',icon:'mdi-content-save',},],posts:[{id:57656,num:0,uid:2127,content:'\u003Cp\u003E不能白嫖了,悲\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-18 22:03:51',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:57657,num:1,uid:10339,content:'\u003Cp\u003E地崩了?\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-18 22:06:13',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:57658,num:2,uid:1749,content:'\u003Cp\u003E会员也不贵啊。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-18 22:06:16',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:57659,num:3,uid:8500,content:'\u003Cp\u003E话说,那500还打算还么?\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-18 22:08:48',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:57660,num:4,uid:11538,content:'\u003Cp\u003E白天应该不限速吧 \u003Cimg src\u003D\"/z/img/xhj/001.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-19 11:26:30',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:57661,num:5,uid:4371,content:'\u003Cp\u003E充点吧兄弟 \u003Cimg src\u003D\"/z/img/yct/002.webp\"\u003E\u003Cbr\u003E都冲点灵度能低点\u003Cbr\u003E一百多不贵 \u003Cimg src\u003D\"/z/img/xhj/017.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-19 11:27:54',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:57662,num:6,uid:8998,content:'\u003Cp\u003E充不了一点,没米了\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-19 11:32:11',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:57663,num:7,uid:4371,content:'\u003Cp\u003E马上有开放平台了\u003Cbr\u003E能挂alist什么的了\u003Cbr\u003E能充点\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-19 11:34:44',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:57664,num:8,uid:1566,content:'\u003Cp\u003E白天也限速,7*24小时限速\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-19 12:52:59',updatedAt:'2025-03-19 17:17:31',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[11538,{uid:11538,url:'/u/1478463a6a045d7665695e6f0d253a32',avatar:'/a/1478463a6a045d7665695e6f0d253a32',username:'yiyule🤖',}],[1749,{uid:1749,url:'/u/087041246a045c76676e5f6f3b0e2110',avatar:'/a/087041246a045c76676e5f6f3b0e2110',username:'Tony🤖',}],[2127,{uid:2127,url:'/u/627859066a045c756168516f4e063f1f',avatar:'/a/627859066a045c756168516f4e063f1f',username:'Remyy🤖',}],[8998,{uid:8998,url:'/u/113d04376a045c7f69635e6f2e251177',avatar:'/a/113d04376a045c7f69635e6f2e251177',username:'001kkk🤖',}],[1566,{uid:1566,url:'/u/283c6a546a045c76656c506f0628277e',avatar:'/a/283c6a546a045c76656c506f0628277e',username:'twamix🤖',}],[4371,{uid:4371,url:'/u/6a23772e6a045c73636d576f353e3d02',avatar:'/a/6a23772e6a045c73636d576f353e3d02',username:'abcdshiwo🤖',}],[8500,{uid:8500,url:'/u/093a592c6a045c7f656a566f390d1a17',avatar:'/a/093a592c6a045c7f656a566f390d1a17',username:'Dove🤖',}],[10339,{uid:10339,url:'/u/0b006b206a045d7763695f6f2251382b',avatar:'/a/0b006b206a045d7763695f6f2251382b',username:'636191🤖',}],]),related:[{title:'问一个关于 alist 的问题',url:'/d/2f2605276a045c77606a56754451606a27001518',},{title:'阿里云盘 WebDAV 体验如何?',url:'/d/3419615b6a045c77606a5675445a626a050a1e33',},{title:'onedrive国区和外区的使用有区别吗',url:'/d/357d0a356a045c77606a5674415e6b6a24376a35',},{title:'one drive 和 dropbox,我该选哪个?',url:'/d/6c3c5e216a045c77606a56744650666a150b0027',},{title:'115这波,估计钱是要不回来了,要么拖着遥遥无期,要么继续用余额买会员。好在也是刚需',url:'/d/180b75596a045c77606a56744651666a5e0d6b01',},{title:'收个115网盘,100t左右',url:'/d/3b0f6a206a045c77606a5674465f616a58280425',},{title:'百度网盘合租',url:'/d/6f047f586a045c77606a56744750646a3f0d3f3b',},{title:'个人照片数据放在百度或阿里云盘有风险吗?',url:'/d/0326433f6a045c77606a56774f5e656a591a1934',},{title:'城通网盘买了个终身会员',url:'/d/1725623a6a045c77606a5677405c666a54393d03',},{title:'求助哪里有有靠谱的网盘',url:'/d/2c04645c6a045c77606a5677415d656a2f0e3520',},{title:'收个收个收个 阿里云盘永久容量 阿里云盘',url:'/d/1c7803066a045c77606a567741586b6a5a7a6b06',},{title:'百度网盘现在限制设备,开车具体怎么开?',url:'/d/2a0168296a045c77606a56774350656a263b6b64',},{title:'有服务器、网盘、nas、公网IP怎么搞一套最好的图床',url:'/d/340a7e026a045c77606a5677435d666a01316315',},{title:'你的115提现到账了吗?',url:'/d/297078216a045c77606a5677455e6a6a14000727',},{title:'收一个天翼云盘10t',url:'/d/68237c1f6a045c77606a56774559626a5f3a3514',},{title:'感觉115要玩庞氏骗局了?',url:'/d/390460046a045c77606a56774758666a23712317',},{title:'115 签到500到账啦',url:'/d/002f051d6a045c77606a56764e5e6b6a3822653f',},{title:'快讯 听说115签到的返现到余额?',url:'/d/2b0a71556a045c77606a56764e5a676a1e006a07',},{title:'相当于免费用三年/500用115六年,老板做慈善吗?',url:'/d/141d4a1b6a045c77606a56764e58626a0f1b0567',},{title:'115 618签到返现可以提现了!',url:'/d/620677186a045c77606a56764e596b6a28073530',},],} const App={setup(){const goTo=useGoTo() const{mdAndUp}=useDisplay() return{goTo,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)} if(this.nav.post.total>(this.nav.post.currentPage-1)*100+20){let moreLen=100 if(this.nav.post.total({id:null,num:(this.nav.post.currentPage-1)*100+v,uid:null,content:null,ipRegion:null,updatedByUid:null,createdAt:null,updatedAt:null,mentionNum:null,mentionedBy:null,mentionUsers:null,likeUsers:null,})) this.posts.push(...morePosts.slice(20))} this.workerStart() const hash=window.location.hash const match=hash.match(/#(\d+)/) if(match){const n=parseInt(match[1],10) if(n>=(this.nav.post.currentPage-1)*100&&n{this.jumpTo(n)})}} this.$nextTick(()=>{this.addHeadingIds() tocbot.init({tocSelector:'.toc',contentSelector:'#post-content-0',headingSelector:'h2, h3, h4',headingsOffset:100,scrollSmoothOffset:-100,scrollSmooth:true,collapseDepth:6,onClick:function(e){setTimeout(()=>{history.replaceState(null,'',window.location.pathname+window.location.search)},0)},}) tocbot.refresh()});},beforeUnmount(){this.workerStop() if(this.quill){this.quill.destroy() this.quill=null}},computed:{dposts(){return this.posts.slice(20);},},created(){},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,this.nav.post.targetPage>1?`/${this.nav.post.targetPage}`:'') window.location.href=url},toLoadRelated({done}){if(this.my&&this.my.uid){this.apiLoadRelated({done})}else{done('ok')}},workerStart(){this.nav.post.worker=setInterval(()=>{this.workerLoad()},500);},workerStop(){if(this.nav.post.worker){clearInterval(this.nav.post.worker);this.nav.post.worker=null;}},async jumpTo(num){const page=Math.floor(num/100)+1 const i=num-(page-1)*100 if(page===this.nav.post.currentPage){this.goTo("#post-"+num,this.nav.post.goToOptions) if(!this.posts[i].id){const block=Math.floor(num/20)+1 this.nav.post.apiLock[block]=true await this.apiLoadPosts(block) this.$nextTick(()=>{this.goTo("#post-"+num,this.nav.post.goToOptions)})}}else{let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,page>1?`/${page}`:'') url=url+"#"+num window.location.href=url}},postIntersect(num){return(isIntersecting,entries,observer)=>{if(isIntersecting){this.nav.post.task.push(num) this.nav.post.active.push(num) this.nav.post.active=this.nav.post.active.filter(item=>Math.abs(item-num)<=5) this.nav.post.active.sort((a,b)=>a-b)}else{this.nav.post.active=this.nav.post.active.filter(item=>item!==num)} if(this.nav.post.active[0]){this.nav.post.anchor=this.nav.post.active[0]}else{this.nav.post.anchor=0}}},async apiLoadPosts(block){try{const response=await axios.post('/fapi/v1/post/block/'+block,{discussionId:this.nav.post.discussionId,}) if(response.data.code===0){response.data.data.posts.forEach(post=>{const i=post.num%100 Object.assign(this.posts[i],post)}) response.data.data.users.forEach(user=>{this.usersMap.set(user.uid,user)})}else{this.failureAlert('回帖数据加载失败: '+response.data.msg)}}catch(error){this.failureAlert('回帖数据加载失败: '+error)} this.nav.post.apiLock[block]=false},workerLoad(){while(this.nav.post.task.length){const num=this.nav.post.task.pop() const i=num-(this.nav.post.currentPage-1)*100 if(!this.posts[i].id){const block=Math.floor(num/20)+1 if(!this.nav.post.apiLock[block]){this.nav.post.apiLock[block]=true this.apiLoadPosts(block)}}}},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diffpost.num===num) if(!post){return "#"+num} const uid=post.uid const username=this.usersMap.get(uid)?.username if(!username){return "#"+num} return username},getUsernameByPostId(id){const post=this.posts.find(post=>post.id===id) if(!post){return "#"+this.getPostNumByPostId(id)} const uid=post.uid const username=this.usersMap.get(uid).username if(!username){return "#"+this.getPostNumByPostId(id)} return username},getPostNumByPostId(id){const post=this.posts.find(post=>post.id===id) return post.num},getPostById(id){const post=this.posts.find(post=>post.id===id) return post},getPostByNum(num){const post=this.posts.find(post=>post.num===num) return post},getAvatarByUid(uid){const avatar=this.usersMap.get(uid)?.avatar if(!avatar){return this.getRandomAvatar()} return avatar},getAvatarByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post){return this.getRandomAvatar()} const uid=post.uid return this.getAvatarByUid(uid)},getRandomAvatar(){const num=Math.floor(Math.random()*100) return "https://randomuser.me/api/portraits/men/"+num+".jpg"},getUrlByUid(uid){const url=this.usersMap.get(uid)?.url if(!url){return ""} return url},getTextByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post||!post.content){return '点击跳转到#'+num+'查看'} const parser=new DOMParser() const doc=parser.parseFromString(post.content,'text/html') const text=doc.body.textContent||'' return text.slice(0,100)},addHeadingIds(){const content=document.getElementById('post-content-0') if(!content){this.nav.showTOC=false return} const headings=content.querySelectorAll('h2, h3, h4') headings.forEach((heading,index)=>{if(!heading.id){heading.id=`toc-nav-${index}`}}) if(headings.length==0){this.nav.showTOC=false}},async doSearch(keywords){this.search.loading=true try{const response=await axios.post('/fapi/v1/search',{keywords:keywords,}) if(response.data.code===0){if(response.data.data.hash&&response.data.data.hash.length===32){window.location.href="/s/"+response.data.data.hash}else{this.failureAlert('搜索失败: 搜索服务异常')}}else{this.failureAlert('搜索失败: '+response.data.msg)}}catch(error){this.failureAlert('搜索失败: '+error)} this.search.loading=false},debounce(fn,delay){let timer=null return function(...args){if(timer)clearTimeout(timer) timer=setTimeout(()=>{fn.apply(this,args)},delay);};},},watch:{'nav.post.targetPage':{handler:async function(newV,oldV){this.toPage()},immediate:false},},} const vuetify=createVuetify({defaults:{global:{ripple:true,},},}) const app=createApp(App) app.use(vuetify).mount("#app")