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:5755,currentPage:1,targetPage:1,total:11,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:66235,num:0,uid:1418,content:'\u003Cp\u003E1520元开了个城通网盘买了个终身会员,以前有很多资源的\u003Cbr\u003E\u003Cimg src\u003D\"https://i.postimg.cc/pTG27Ssj/image.jpg\" alt\u003D\"image\"\u003E\u003Cbr\u003E用了下很不好用,就是看便宜才买的,支持的WebDAV协议也不好用\u003Cbr\u003E还分开的是(私有云webd**地址:https://webd**.ctfile.com ,公有云webd**地址:https://pubd**.ctfile.com)\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:26:05',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66236,num:1,uid:1858,content:'\u003Cp\u003E城通是最**的网盘,没有之一\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:27:30',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66237,num:2,uid:10441,content:'\u003Cp\u003E有钱人\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:27:50',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66238,num:3,uid:3222,content:'\u003Cp\u003E广告盘\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:29:14',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66239,num:4,uid:3554,content:'\u003Cp\u003E\u003Cimg src\u003D\"/z/img/xhj/014.webp\"\u003E 以前多现在没有资源啊\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:29:47',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66240,num:5,uid:4428,content:'\u003Cp\u003E1520,购买个好nas了 \u003Cimg src\u003D\"/z/img/xhj/002.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:29:48',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66241,num:6,uid:11029,content:'\u003Cp\u003E糊涂呀小老板\u003Cbr\u003E原来它推广时候给人用的,个人用是真没啥体验\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:30:16',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66242,num:7,uid:9150,content:'\u003Cp\u003E这个100的话,我都得犹豫,不是我黑他!\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:30:57',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66243,num:8,uid:3151,content:'\u003Cp\u003E这真能赚钱吗\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:33:08',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66244,num:9,uid:1418,content:'\u003Cp\u003E 有台NAS一年难用一两次吃灰中 有3台瓦工也吃灰中\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:33:12',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:66245,num:10,uid:3605,content:'\u003Cp\u003E糊涂啊老板\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 18:33:44',updatedAt:'2025-03-22 12:11:44',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[1418,{uid:1418,url:'/u/1c226b246a045c76646b5e6f03303817',avatar:'/a/1c226b246a045c76646b5e6f03303817',username:'sxhz88🤖',}],[9150,{uid:9150,url:'/u/1d1d76246a045c7e616f566f130c0675',avatar:'/a/1d1d76246a045c7e616f566f130c0675',username:'jieke1234🤖',}],[3605,{uid:3605,url:'/u/2d2060096a045c74666a536f14061c77',avatar:'/a/2d2060096a045c74666a536f14061c77',username:'**爱搞机🤖',}],[3554,{uid:3554,url:'/u/0d2e40206a045c74656f526f00331708',avatar:'/a/0d2e40206a045c74656f526f00331708',username:'花儿🤖',}],[11029,{uid:11029,url:'/u/681d56236a045d7660685f6f3d591d7e',avatar:'/a/681d56236a045d7660685f6f3d591d7e',username:'kasuganosora🤖',}],[1858,{uid:1858,url:'/u/3f076b0e6a045c76686f5e6f15260a0e',avatar:'/a/3f076b0e6a045c76686f5e6f15260a0e',username:'highpingwarrior🤖',}],[3151,{uid:3151,url:'/u/6d38540b6a045c74616f576f3d2c6503',avatar:'/a/6d38540b6a045c74616f576f3d2c6503',username:'NSjj🤖',}],[10441,{uid:10441,url:'/u/1d0702026a045d77646e576f22023e34',avatar:'/a/1d0702026a045d77646e576f22023e34',username:'task5788🤖',}],[4428,{uid:4428,url:'/u/0f007c156a045c7364685e6f4319152c',avatar:'/a/0f007c156a045c7364685e6f4319152c',username:'414522569🤖',}],[3222,{uid:3222,url:'/u/123f63556a045c746268546f4f223f35',avatar:'/a/123f63556a045c746268546f4f223f35',username:'glow🤖',}],]),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/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/2a3d653c6a045c77606a5677475d606a2b162434',},{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")