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:5876,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:67309,num:0,uid:1470,content:'\u003Cp\u003E个人照片信息等,在不加密的情况下存放百度或阿里云盘,有风险吗?\u003Cbr\u003E我就这么问一下。 \u003Cimg src\u003D\"/z/img/xhj/001.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:38:56',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67310,num:1,uid:7785,content:'\u003Cp\u003E放别人服务都有风险,前两天百度一老总子女开盒别人事件\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:40:55',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67311,num:2,uid:12596,content:'\u003Cp\u003Ehttps://baijiahao.baidu.com/s?id\u003D1810230869848805842\u0026amp;wfr\u003Dspider\u0026amp;for\u003Dpc\u003Cbr\u003E去年的新闻 阿里云盘突发“灾难级 Bug”,创建相册之后可以随意观看他人照片\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:41:13',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67312,num:3,uid:1470,content:'\u003Cp\u003E 不是说用的国外的库吗,不能混为一谈吧\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:41:35',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67313,num:4,uid:1470,content:'\u003Cp\u003E 这个新闻好像见过,然后不了了之了。。。离谱啊\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:42:22',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67314,num:5,uid:1761,content:'\u003Cp\u003E大厂数据库泄露 隐私泄露事件还少吗\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:43:04',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67315,num:6,uid:7618,content:'\u003Cp\u003E百度副总裁的十三岁的大小姐都能随便看用户信息\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:43:28',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67316,num:7,uid:7785,content:'\u003Cp\u003E 这就算真是百度出去的,也不敢承认啊!\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:44:20',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67317,num:8,uid:3455,content:'\u003Cp\u003E百度开盒那个,被开盒的女人的老公微信都被找出来了\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:44:35',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67318,num:9,uid:1585,content:'\u003Cp\u003E都有的 最好本地冷备份\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:57:23',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67319,num:10,uid:10976,content:'\u003Cp\u003E存在自己电脑里就安全吗?各种软件都在扫你的硬盘数据。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 23:00:54',updatedAt:'2025-03-22 12:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[10976,{uid:10976,url:'/u/3319451e6a045d77696d506f1a13367f',avatar:'/a/3319451e6a045d77696d506f1a13367f',username:'hasateks🤖',}],[3455,{uid:3455,url:'/u/6a3d03096a045c74646f536f1a0a240c',avatar:'/a/6a3d03096a045c74646f536f1a0a240c',username:'tupdys🤖',}],[12596,{uid:12596,url:'/u/17215e2f6a045d756563506f21241108',avatar:'/a/17215e2f6a045d756563506f21241108',username:'meowth🤖',}],[1585,{uid:1585,url:'/u/3b0b445d6a045c766562536f222c3c1e',avatar:'/a/3b0b445d6a045c766562536f222c3c1e',username:'Mofeng🤖',}],[7618,{uid:7618,url:'/u/0d3f51276a045c70666b5e6f4f1a1102',avatar:'/a/0d3f51276a045c70666b5e6f4f1a1102',username:'蔡徐坤🤖',}],[7785,{uid:7785,url:'/u/300d635d6a045c706762536f0e0d1d29',avatar:'/a/300d635d6a045c706762536f0e0d1d29',username:'Share🤖',}],[1761,{uid:1761,url:'/u/2824461b6a045c76676c576f1d311c16',avatar:'/a/2824461b6a045c76676c576f1d311c16',username:'夜轻🤖',}],[1470,{uid:1470,url:'/u/221966176a045c76646d566f4e502a2a',avatar:'/a/221966176a045c76646d566f4e502a2a',username:'石原里美🤖',}],]),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/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")