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:7982,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:39,url:'/t/63287c046a045c7469771524140c',name:'腾讯云',color:'#66BB6A',icon:'mdi-tag-heart',},],posts:[{id:102518,num:0,uid:4318,content:'\u003Cp\u003E腾讯阿里似乎都是双向500g后开始限速🤔,限速后换了个ip还是1m,有人知道小黑屋要限速多久吗\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 00:08:36',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102519,num:1,uid:3515,content:'\u003Cp\u003E没人知道,默认永久好了\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 00:14:54',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102520,num:2,uid:16166,content:'\u003Cp\u003E一天双向500G吗还是一个月\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 00:15:03',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102521,num:3,uid:3515,content:'\u003Cp\u003E首发买的,10g限速几天都不解抓紧退款\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 00:15:51',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102522,num:4,uid:5379,content:'\u003Cp\u003E想太多了单向500g。阿里跑3~40G就限了\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 00:26:03',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102523,num:5,uid:4097,content:'\u003Cp\u003E100G我就知足了,别说500G。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 00:35:08',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102524,num:6,uid:3392,content:'\u003Cp\u003E没500g的说法,限速纯看运气\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 00:35:47',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102525,num:7,uid:17492,content:'\u003Cp\u003E阿里香港轻量28那款BGP 似乎是75GB后限速20M 我反正跑了一整个月了 都收20M以上的平均网速 一个月能跑5.4T左右\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 00:58:00',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102526,num:8,uid:16125,content:'\u003Cp\u003E是不是看脸\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 01:09:02',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102527,num:9,uid:17493,content:'\u003Cp\u003E腾讯已经退款销毁了,感觉很恶心。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 01:48:01',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:102528,num:10,uid:17453,content:'\u003Cp\u003E到本地限速 1M,与其它服务器测速正常\u003Cimg src\u003D\"/z/img/xhj/017.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 01:52:41',updatedAt:'2025-04-12 20:12:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[17453,{uid:17453,url:'/u/3071430c6a045d70646f556f1e596128',avatar:'/a/3071430c6a045d70646f556f1e596128',username:'韩飞鱼🤖',}],[4097,{uid:4097,url:'/u/3b23772c6a045c736063516f1f330b7f',avatar:'/a/3b23772c6a045c736063516f1f330b7f',username:'chinanala🤖',}],[16166,{uid:16166,url:'/u/377966026a045d71616c506f132c120a',avatar:'/a/377966026a045d71616c506f132c120a',username:'dweuhf🤖',}],[3392,{uid:3392,url:'/u/0e0e77546a045c746363546f46023f2b',avatar:'/a/0e0e77546a045c746363546f46023f2b',username:'zhoujielun🤖',}],[17493,{uid:17493,url:'/u/6b2e78556a045d706463556f4120272b',avatar:'/a/6b2e78556a045d706463556f4120272b',username:'下一页🤖',}],[16125,{uid:16125,url:'/u/181c7d0b6a045d716168536f05331a30',avatar:'/a/181c7d0b6a045d716168536f05331a30',username:'guoduoduo🤖',}],[3515,{uid:3515,url:'/u/6b0775556a045c74656b536f21586726',avatar:'/a/6b0775556a045c74656b536f21586726',username:'买买鸡🤖',}],[4318,{uid:4318,url:'/u/180300026a045c73636b5e6f231b3936',avatar:'/a/180300026a045c73636b5e6f231b3936',username:'sdds-sdjsj🤖',}],[17492,{uid:17492,url:'/u/2d0f6a226a045d706463546f15062529',avatar:'/a/2d0f6a226a045d706463546f15062529',username:'qwwujh🤖',}],[5379,{uid:5379,url:'/u/3f214a2c6a045c72636d5f6f1b5a1009',avatar:'/a/3f214a2c6a045c72636d5f6f1b5a1009',username:'Hanyoking🤖',}],]),related:[{title:'求教大佬正常建站的话腾讯云海外站锐驰和斯巴达选哪一个 ?',url:'/d/14107f206a045c77606a567a475d646a2e711e18',},{title:'腾讯云CDN现在不送每月流量了吗?',url:'/d/6f78655a6a045c77606a56754f59656a36193136',},{title:'套腾讯CDN需要备案么',url:'/d/0a274b096a045c77606a5675405e6b6a20742108',},{title:'【收】腾讯云锐驰200M 3年5年香港。或者2折3折卷!',url:'/d/157f7d236a045c77606a56754650626a34090a1f',},{title:'腾讯云直播嘎嘎猛',url:'/d/6a13460e6a045c77606a5677435e666a23216311',},{title:'腾讯云发公告了净网行动',url:'/d/193e563c6a045c77606a56774451676a3f226001',},{title:'现在还有没有腾讯200m轻量机器的优惠券收啊',url:'/d/0e0e74256a045c77606a56774558646a00271410',},{title:'收个腾讯云香港锐驰200M 月付40',url:'/d/6f7e701b6a045c77606a56764751646a0e003161',},{title:'1388出腾讯200M上海,到期时间2030年, 可以开启v6',url:'/d/301b59596a045c77606a56714158646a0f0f0720',},{title:'收腾讯广州锐驰 【已收】',url:'/d/3e10705f6a045c77606a5671425c676a1d131022',},{title:'腾讯云不同账号的轻量可以内网互通吗',url:'/d/38000b3a6a045c77606a567144586b6a5f32171c',},{title:'腾讯好像又可以领续费3.5折的卷,想知道支持锐驰200M吗',url:'/d/3d0764276a045c77606a56704e506a6a223b6a20',},{title:'阿里云腾讯云国内版除了当专线的前置,还能干点啥?',url:'/d/342e57086a045c77606a56704e5f636a22250166',},{title:'腾讯云2025新春采购99/年拼团续费同价',url:'/d/2c2b0b0b6a045c77606a56704f5c6b6a140c3039',},{title:'【已出】腾讯上海200M+肥仔ix1元机',url:'/d/127051376a045c77606a5670425d616a1b362103',},{title:'建站除了套路云/凉心云之外有无别的推荐?',url:'/d/3b08441d6a045c77606a56704458656a183b041f',},{title:'我觉得腾讯阿里还不如把200m改成500g左右流量这样',url:'/d/0306022b6a045c77606a56734e58606a280a3f62',},{title:'收个腾讯云无忧125(上海地区',url:'/d/2f1b035b6a045c77606a5672415d666a040a2b11',},{title:'收个腾讯无忧125',url:'/d/2d7a0a3c6a045c77606a56724251616a0406001d',},{title:'腾讯云锐驰能吃码子吗?收一个',url:'/d/1c3853346a045c77606a5672425f636a1d761219',},],} 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")