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:3967,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:38,url:'/t/3e0b66186a045c7468772a362e2f',name:'阿里云',color:'#66BB6A',icon:'mdi-tag-heart',},],posts:[{id:45561,num:0,uid:2181,content:'\u003Cp\u003E拿来当发布页的!就1个单页\u003Cbr\u003E有用过的佬没,我boce了一下,一会儿1个IP,一会儿2个IP\u003Cbr\u003E是不是默认IP无法访问,自动换的?\u003C/p\u003E\u003Cp\u003E\u003Cimg src\u003D\"https://uy.wzznft.com/i/2025/03/16/x9ata7.png\" alt\u003D\"\"\u003E\u003Cbr\u003E\u003Cimg src\u003D\"https://uy.wzznft.com/i/2025/03/16/x5us7o.png\" alt\u003D\"\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:09:52',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45562,num:1,uid:1423,content:'\u003Cp\u003Eoss国际版\u003Cbr\u003E还能套cf免流呢\u003C/p\u003E\u003Cp\u003E你搜下\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:10:37',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45563,num:2,uid:2181,content:'\u003Cp\u003E 这么秀?哈哈哈哈,不过我就9KB,能消耗啥流量!\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:12:51',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45564,num:3,uid:1947,content:'\u003Cp\u003E 套cf不延迟更大?\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:14:04',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45565,num:4,uid:1423,content:'\u003Cp\u003E带宽联盟啦\u003Cbr\u003E香港oss延迟也挺大的\u003C/p\u003E\u003Cp\u003E我也不知道能不能挂claw走内网\u003Cbr\u003E不知道行不行\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:17:20',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45566,num:5,uid:2181,content:'\u003Cp\u003E 我延迟要求还好不高,能访问就行! 我是怕墙,我一个发布页,江苏墙,江苏墙完福建墙,难受死\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:22:40',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45567,num:6,uid:2181,content:'\u003Cp\u003E 你不是卖备案域名,那个玩意儿大概能活多久,拿来做个API用国内CDN那就更香了,就是怕死,死了用户体验不好!\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:23:31',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45568,num:7,uid:1947,content:'\u003Cp\u003E 1天-永久都可能,看脸,我查了最近一个月掉下来的,以往只有十分一会在一个月内掉,现在涨到五分一了,越来越难搞,所以现在我都精选过,可以解析到官网,共用一个备案,共用一套主体,因为一切都看起来没删除过。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:26:48',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45569,num:8,uid:10218,content:'\u003Cp\u003EOSS的默认域名的话本来就有多个IP的,另外可以选择加速回源,速度还挺好。\u003Cbr\u003E发布页的话,用Azure Blob罢\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:31:34',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45570,num:9,uid:2181,content:'\u003Cp\u003E 据说要保备案,备案信息与域名实名信息不一致的时候,备案服务商要打电话问域名备案人,难搞。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:53:09',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:45571,num:10,uid:2181,content:'\u003Cp\u003E 我Azure瞎瘠薄点了SSL证书,还欠它1000多刀,嚓!没法搞啊\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-16 20:54:02',updatedAt:'2025-03-18 12:00:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[10218,{uid:10218,url:'/u/153d7c3d6a045d77626b5e6f465e0308',avatar:'/a/153d7c3d6a045d77626b5e6f465e0308',username:'seb365🤖',}],[1947,{uid:1947,url:'/u/6a035c0a6a045c76696e516f182f2674',avatar:'/a/6a035c0a6a045c76696e516f182f2674',username:'隔离有鬼🤖',}],[2181,{uid:2181,url:'/u/6f046a3e6a045c756162576f3e5e0104',avatar:'/a/6f046a3e6a045c756162576f3e5e0104',username:'wasepf🤖',}],[1423,{uid:1423,url:'/u/143d7e5e6a045c766468556f4e243c01',avatar:'/a/143d7e5e6a045c766468556f4e243c01',username:'Dogelee2🤖',}],]),related:[{title:'阿里云香港轻量和 ECS 网络一样吗?',url:'/d/680d761b6a045c77606a56754e5f6a6a0e2d2a3b',},{title:'出阿里云🇭🇰e1,2029.10.29过期 2000Mbps',url:'/d/3c1d4b096a045c77606a56754f58616a1e026662',},{title:'阿里ecs,阿里轻量,isif,wawo pis claw Yxvm-hyper skystroll 网络横评',url:'/d/020862066a045c77606a5675405f616a0b2c121e',},{title:'请问阿里云轻量200MB可以push吗,想收个阿里云广州和上海,和香港',url:'/d/371d0a046a045c77606a56754750666a397a0061',},{title:'老哥们现在阿里国内200m的限速怎么样了',url:'/d/350d712a6a045c77606a5674405d606a04251239',},{title:'【已出】IX前置车 阿里云国内六地可选',url:'/d/0270783d6a045c77606a56744651616a3b1a2b03',},{title:'阿里云轻量新增公网线路类型BGP_NCO',url:'/d/1b2742066a045c77606a5677445e6b6a2f1b1623',},{title:'明盘80push出阿里云日本ecs一年半',url:'/d/12796b096a045c77606a5677455d6b6a54312606',},{title:'出阿里云2h512m20G杭州CDT 2029.6.18到期',url:'/d/192c7b3d6a045c77606a5676405d626a5f36236a',},{title:'个人买云服务器最便宜的是哪家',url:'/d/2a0653246a045c77606a5676425d6a6a18306b2b',},{title:'阿里云HK轻量、DD的系统。咋还自动给我禁用ssh-rsa密钥【改用ed25519】',url:'/d/1d2d4b1f6a045c77606a5676435a636a2608161c',},{title:'阿里云吃灰中...删我机器,剩余费用给退了',url:'/d/2c7b7a596a045c77606a5676455b606a5d37013c',},{title:'阿里云38/年的轻量可以push吗',url:'/d/097d403d6a045c77606a5676475c636a1b2d311a',},{title:'求助:阿里云重装系统失败',url:'/d/1605445a6a045c77606a56714f5c646a1f136128',},{title:'大佬们,DD系统后阿里云服务器没办法运行脚本是什么原因啊?',url:'/d/3f21731e6a045c77606a567140516a6a152f6727',},{title:'大佬们,问个关于阿里38元年付机的问题',url:'/d/0c0b7d096a045c77606a5671405a666a3a1b0323',},{title:'(已出)阿里云',url:'/d/6b2c591a6a045c77606a56714550666a1e7a3c35',},{title:'刚发现阿里云99可以push',url:'/d/1e1f5d3c6a045c77606a5671465a6b6a393b6036',},{title:'明盘50出个阿里云hk ecs',url:'/d/1f7f6b066a045c77606a5671465b6a6a000d1202',},{title:'[已出]明盘50出一个阿里香港轻量',url:'/d/3071485b6a045c77606a567147506b6a0b3a3c28',},],} 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")