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:8270,currentPage:1,targetPage:1,total:101,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:[],posts:[{id:107297,num:0,uid:250,content:'\u003Cp\u003E/t/1006613\u003C/p\u003E\u003Cblockquote\u003E\u003Cp\u003E 2024-01-07 13 个赞啥挑战消费者啊,不就是一群搞 pcdn 借着家宽干 tob 业务吗,不要绑架所有消费者行不行我个人双手赞成封 pcdn ,严重干扰正常用户的使用体验\u003C/p\u003E\u003C/blockquote\u003E\u003Cp\u003E不过这个哥的号已经无了。。不知道发生了什么。。。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:23:24',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107298,num:1,uid:12048,content:'宽带月上传流量超过 1TB\u003Cbr\u003Enat1 改 nat4\u003Cbr\u003E真公网 ipv4 改伪公网 ipv4 ,\u003Cbr\u003Evbras 100.64--100.127 开头\u003Cbr\u003E取消 ipv6\u003Cbr\u003E限制上传带宽 5Mbps\u003Cbr\u003E限制连接数 1024\u003Cbr\u003E限制 dns 解析频率\u003Cbr\u003E限制接入 10000 台人工客服',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:26:00',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[11,],mentionUsers:[],likeUsers:[],},{id:107299,num:2,uid:250,content:' PCDN 太坏了.jpg',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:27:57',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107300,num:3,uid:2374,content:'pcdn 都是白莲花, 我真是闲得没事, 玩下 bt 还得跑 pbh',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:44:00',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[5,],mentionUsers:[],likeUsers:[],},{id:107301,num:4,uid:2360,content:'pcdn 抢占个人家宽上传和个人网站 cdn ,直接造成损失。对个人站长那可是真金白银的经济损失。为什么不能反 pcdn 。要不要我发给你看看那些 pcdn 玩家的心态,就在 v2 的帖子。那些个人宽带和个人网站 cdn 被刷理所应当。他可不觉得有问题。所以这才是 pcdn 的问题。吸着别人的血还觉得没问题。运营商的问题不影响 pcdn 对普通用户的损害。两者都有问题也不影响我骂 pcdn ,只要他刷流量我就骂他。pcdn 的敢说自己没刷过?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:53:13',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107302,num:5,uid:2427,content:'#3 是的,几年前开个软件就行了,从来没想到还有这么多主动恶意的用户,现在要是不开屏蔽软件(或者自带屏蔽的 bt 软件),必被刷上传',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:01:31',updatedAt:'2025-04-16 23:08:23',mentionNum:3,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107303,num:6,uid:250,content:'呃,我说的是现在运营商砍上行的问题。。。。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:02:31',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107304,num:7,uid:13059,content:'重要原因是国内流量费太贵了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:05:40',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107305,num:8,uid:2360,content:' 我就说的 pcdn 吸我上行。我的上行也没砍。因为我连千兆都没上。家宽千兆要来干嘛,一直没想法',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:06:37',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107306,num:9,uid:923,content:'传网盘的都被限速了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:21:20',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107307,num:10,uid:18149,content:'确实。搞得现在都不敢上传了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:38:23',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107308,num:11,uid:417,content:'#1 确定是 1T 吗?我看到网上有些人上行几百 G 、甚至只有几十 G 的都被限速了(好像是恩山论坛)。。。就感觉很恐怖啊。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:40:45',updatedAt:'2025-04-16 23:08:23',mentionNum:1,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107309,num:12,uid:12048,content:'大部分地方是 1TB',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:43:15',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107310,num:13,uid:2706,content:'本来就是 pcdn 的问题,有什么好讨论的。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:44:52',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107311,num:14,uid:2718,content:'明天来运营部',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:55:29',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107312,num:15,uid:241,content:'\u003Cimg src\u003D\"https://i.imgur.com/dyCKUYx.png\"\u003E\u003Cbr\u003E割地事秦',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 11:25:03',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[19,],mentionUsers:[],likeUsers:[],},{id:107313,num:16,uid:4583,content:'pcdn 和运营商的恩怨与我无关,但是有些没有底线的 pcdn 运营者通过刷 cdn 来对抗这件事,没什么可洗的,**贱业。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 11:29:44',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107314,num:17,uid:18150,content:'谁赚钱谁的问题呗,直观来看第一是运营商垄断,第二是 pcdn 服务和用户,普通用户也没靠这个直接盈利。\u003Cbr\u003E搞 pcdn 的自己站出来直接被 ban, 而且还赚钱了,这个东西多少有点道德瑕疵。而且我觉得压力普通用户也不会有任何用,因为很多人 1.5T 真的够用了。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 11:33:14',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107315,num:18,uid:2216,content:'pcdn 普通用户能跑几个,就是运营商内鬼拿着剩余资源在那刷的,现在扛不住了又开始降本增笑了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 12:18:51',updatedAt:'2025-04-16 23:08:23',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107316,num:19,uid:417,content:'#15 图片说的出省流量大的,但为什么很多同城互传的上行大的也被限速呢?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 12:27:15',updatedAt:'2025-04-16 23:08:23',mentionNum:15,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[241,{uid:241,url:'/u/16034b1b6a045c77626e576f45222332',avatar:'/a/16034b1b6a045c77626e576f45222332',username:'1423🤖',}],[18149,{uid:18149,url:'/u/2a0b78036a045d7f616e5f6f3b5c3676',avatar:'/a/2a0b78036a045d7f616e5f6f3b5c3676',username:'noxworld🤖',}],[2374,{uid:2374,url:'/u/6e7a41286a045c75636d526f30513f12',avatar:'/a/6e7a41286a045c75636d526f30513f12',username:'jqtmviyu🤖',}],[417,{uid:417,url:'/u/02256b226a045c77646b516f341e3e20',avatar:'/a/02256b226a045c77646b516f341e3e20',username:'liuzimin🤖',}],[250,{uid:250,url:'/u/680156286a045c77626f566f3d282502',avatar:'/a/680156286a045c77626f566f3d282502',username:'est🤖',}],[4583,{uid:4583,url:'/u/187a7b0a6a045c736562556f47061217',avatar:'/a/187a7b0a6a045c736562556f47061217',username:'unclemcz🤖',}],[12048,{uid:12048,url:'/u/6c1d75216a045d75606e5e6f191f3d1f',avatar:'/a/6c1d75216a045d75606e5e6f191f3d1f',username:'youx🤖',}],[923,{uid:923,url:'/u/0f057b276a045c776968556f3c51290c',avatar:'/a/0f057b276a045c776968556f3c51290c',username:'xmumiffy🤖',}],[2427,{uid:2427,url:'/u/0d2a435a6a045c756468516f12046371',avatar:'/a/0d2a435a6a045c756468516f12046371',username:'chesha1🤖',}],[13059,{uid:13059,url:'/u/1623421e6a045d74606f5f6f362d6a72',avatar:'/a/1623421e6a045d74606f5f6f362d6a72',username:'zhandouji2023🤖',}],[2718,{uid:2718,url:'/u/1c3107076a045c75676b5e6f40042305',avatar:'/a/1c3107076a045c75676b5e6f40042305',username:'huihuilang🤖',}],[2706,{uid:2706,url:'/u/6f7e625b6a045c75676a506f1f5e6b22',avatar:'/a/6f7e625b6a045c75676a506f1f5e6b22',username:'icy37785🤖',}],[2360,{uid:2360,url:'/u/0d1b7a5b6a045c75636c566f05056117',avatar:'/a/0d1b7a5b6a045c75636c566f05056117',username:'allin1🤖',}],[18150,{uid:18150,url:'/u/190878376a045d7f616f566f0f2c6a30',avatar:'/a/190878376a045d7f616f566f0f2c6a30',username:'ButcherHu🤖',}],[2216,{uid:2216,url:'/u/6d1d741e6a045c75626b506f4418203e',avatar:'/a/6d1d741e6a045c75626b506f4418203e',username:'Dk2014🤖',}],]),related:[],} 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")