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:6195,currentPage:1,targetPage:1,total:43,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:72211,num:0,uid:3785,content:'最近想搞一个网盘,看了 one drive 和 dropbox ,选择困难症。\u003Cbr\u003E\u003Cbr\u003E大家有用过的来分析一下,可以从各个方面分析,安全、速度、稳定等等方面都可以。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 20:53:29',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72212,num:1,uid:2447,content:'我选 Dropbox\u003Cbr\u003E\u003Cbr\u003EOnedrive 开始耍流氓了。。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 21:08:45',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72213,num:2,uid:242,content:'主要看你要多少 GB ,以及你有没有钱。能负担的情况下尽量选 dropbox 。\u003Cbr\u003Eonedrive 只有价格优势,没有其他优势。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 21:11:38',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72214,num:3,uid:2715,content:'OneDrive 的优势是价格优势,如果你在这两个里面选择说明你 OneDrive 要买贵了',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 21:15:23',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72215,num:4,uid:4515,content:'onedrive 家庭版合租的情况下才几十块,价格优势明显。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 21:17:20',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72216,num:5,uid:224,content:'onedrive 主要是和 office 在一起 比较划算',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 22:33:43',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72217,num:6,uid:2861,content:'20 年前用的 dropbox 居然还这么活跃......',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 22:43:36',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72218,num:7,uid:2395,content:'Onedrive office365 带的,土区很便宜',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 22:47:15',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72219,num:8,uid:5671,content:'只用 Windows 的话就 OneDrive ,因为便宜。\u003Cbr\u003E如果要用 Linux ,OneDrive 是没有官方客户端的,三方的都不好用。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 22:51:48',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72220,num:9,uid:3785,content:'怎么耍流氓?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 23:26:23',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72221,num:10,uid:3785,content:'Dropbox 土区价格还可以,大概 140 一年。和 one drive 价格相差一点,但是不大。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 23:27:58',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72222,num:11,uid:646,content:'选择 CloudDrive ,两个都有',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 23:30:45',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72223,num:12,uid:2639,content:'One drive 没单卖的吧?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 23:31:57',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72224,num:13,uid:3785,content:'app store 订阅,应该是 Microsoft 365 。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 23:33:44',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72225,num:14,uid:4892,content:'24.9GB 免费 dropbox ,够我用了。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 23:40:19',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72226,num:15,uid:2446,content:'onedrive 可以的,价格在那里,而且用户那么多,没问题',ipRegion:'',updatedByUid:0,createdAt:'2025-03-20 23:49:22',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72227,num:16,uid:53,content:'dropbox 土耳其订阅',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 00:13:51',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72228,num:17,uid:11775,content:'土耳其货币贬值,面临涨价风险了',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 06:41:13',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72229,num:18,uid:3785,content:'我看了下 dropbox 、one drive 都还没涨价,icloud+ 去年就涨价了。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 08:04:28',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:72230,num:19,uid:2861,content:'icloud 我都直接上的 icloud 2t ,我从 09 年开始用 dropbox ,最早最早的,早期活动非常大的容量我都忘记了,当时确实是一流的,都快 20 年了,现在如果你 apple 环境,绝对是 icloud 最方便。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 08:22:52',updatedAt:'2025-03-24 23:55:59',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[2447,{uid:2447,url:'/u/1e7f5d186a045c75646e516f1f203573',avatar:'/a/1e7f5d186a045c75646e516f1f203573',username:'Ansen🤖',}],[2639,{uid:2639,url:'/u/3938572c6a045c7566695f6f41070631',avatar:'/a/3938572c6a045c7566695f6f41070631',username:'gpt5🤖',}],[2715,{uid:2715,url:'/u/080d701f6a045c75676b536f3f5e1901',avatar:'/a/080d701f6a045c75676b536f3f5e1901',username:'MoRanjiang🤖',}],[646,{uid:646,url:'/u/6b1368586a045c77666e506f235d0974',avatar:'/a/6b1368586a045c77666e506f235d0974',username:'katwalk🤖',}],[3785,{uid:3785,url:'/u/0c3a6a1e6a045c746762536f00241e36',avatar:'/a/0c3a6a1e6a045c746762536f00241e36',username:'ebadao🤖',}],[11775,{uid:11775,url:'/u/331e7b546a045d76676d536f02501931',avatar:'/a/331e7b546a045d76676d536f02501931',username:'bluetree2039🤖',}],[5671,{uid:5671,url:'/u/627e5f236a045c72666d576f331e2516',avatar:'/a/627e5f236a045c72666d576f331e2516',username:'terence4444🤖',}],[4515,{uid:4515,url:'/u/321d532b6a045c73656b536f21081502',avatar:'/a/321d532b6a045c73656b536f21081502',username:'alect🤖',}],[53,{uid:53,url:'/u/13070b216a045c77606f556f12016b2e',avatar:'/a/13070b216a045c77606f556f12016b2e',username:'zuosiruan🤖',}],[224,{uid:224,url:'/u/0a2576296a045c776268526f15131c77',avatar:'/a/0a2576296a045c776268526f15131c77',username:'565656🤖',}],[2446,{uid:2446,url:'/u/1c10442a6a045c75646e506f155b0221',avatar:'/a/1c10442a6a045c75646e506f155b0221',username:'sickoo🤖',}],[2395,{uid:2395,url:'/u/1c234b0c6a045c756363536f21260204',avatar:'/a/1c234b0c6a045c756363536f21260204',username:'licong🤖',}],[2861,{uid:2861,url:'/u/15027c286a045c75686c576f4f20021f',avatar:'/a/15027c286a045c75686c576f4f20021f',username:'thorby🤖',}],[4892,{uid:4892,url:'/u/0207630e6a045c736863546f275a1424',avatar:'/a/0207630e6a045c736863546f275a1424',username:'Remember🤖',}],[242,{uid:242,url:'/u/1e1c655c6a045c77626e546f1e1c2571',avatar:'/a/1e1c655c6a045c77626e546f1e1c2571',username:'cmdOptionKana🤖',}],]),related:[{title:'问一个关于 alist 的问题',url:'/d/2f2605276a045c77606a56754451606a27001518',},{title:'阿里云盘 WebDAV 体验如何?',url:'/d/3419615b6a045c77606a5675445a626a050a1e33',},{title:'onedrive国区和外区的使用有区别吗',url:'/d/357d0a356a045c77606a5674415e6b6a24376a35',},{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/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")