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:8344,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:63,url:'/t/3005791a6a045c71637723113e02',name:'Gemini',color:'#66BB6A',icon:'mdi-tag-heart',},],posts:[{id:109199,num:0,uid:12814,content:'\u003Cp\u003EYou\u0026#39;ve reached your rate limit. Please try again later.\u003C/p\u003E\u003Cp\u003EFailed to generate content: user has exceeded quota.\u003C/p\u003E\u003Cp\u003E用了两个月,一直好好的,今天忽然提示这个。哪位知道这个限速限额是怎么回事?今天开始的吗?还是以前就有?\u003C/p\u003E\u003Cp\u003E还有这个限速是怎么限速的?多久可以用呢?\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 14:19:09',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109200,num:1,uid:5929,content:'我刚才也碰到了,但等了大概不到一个小时又可以了。在等待过程中我都跑去看要给多少钱开大会员了 😂 因为 2.5 实在太强了,在写代码上,在我这里的体验比 claude 3.7 还强',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 14:59:53',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109201,num:2,uid:12814,content:'关键 google 需要绑卡才能续费。不支持内地银行办理的 visa 卡',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 15:26:11',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109202,num:3,uid:7506,content:'今天才出现的,可我有点离不开 Gemini 2.5 pro 了,不知道怎么办了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 15:39:48',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109203,num:4,uid:18359,content:'API 可以绑内地发的信用卡,我用的工行的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 16:25:47',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109204,num:5,uid:13557,content:'订阅 GitHub Copilot Pro 可以使用 Gemini 2.5 Pro ,但是据说下月开始每月只能用 2000 次',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 16:27:14',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109205,num:6,uid:11109,content:'我用的国内 Master 卡订阅的。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 18:40:42',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109206,num:7,uid:15653,content:'API 免费版一直限制写得都很清楚啊\u003Cbr\u003E2F: 15 RPM 1500 req/day\u003Cbr\u003E2.5P: 5 RPM 25 req/day',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 22:22:08',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109207,num:8,uid:708,content:'Gemini 一直都有限速啊...',ipRegion:'',updatedByUid:0,createdAt:'2025-04-16 08:17:01',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109208,num:9,uid:790,content:'免费的一直有限额的,另外国内卡可以开 API,我中国银行的招商银行的都开过',ipRegion:'',updatedByUid:0,createdAt:'2025-04-16 09:47:24',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:109209,num:10,uid:12814,content:'我用的不是 api 。是在他们自己的官网用的。以前一直没遇到过。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-16 11:15:31',updatedAt:'2025-04-16 23:09:43',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[15653,{uid:15653,url:'/u/2f0e44046a045d72666f556f0d5f6b20',avatar:'/a/2f0e44046a045d72666f556f0d5f6b20',username:'haotian22🤖',}],[11109,{uid:11109,url:'/u/0c036a386a045d76616a5f6f1c241b1f',avatar:'/a/0c036a386a045d76616a5f6f1c241b1f',username:'rebounce🤖',}],[18359,{uid:18359,url:'/u/0c0e5a5f6a045d7f636f5f6f250d3820',avatar:'/a/0c0e5a5f6a045d7f636f5f6f250d3820',username:'Morpheus1102🤖',}],[13557,{uid:13557,url:'/u/3707573b6a045d74656f516f38333201',avatar:'/a/3707573b6a045d74656f516f38333201',username:'gowk🤖',}],[5929,{uid:5929,url:'/u/15045e1c6a045c7269685f6f05501577',avatar:'/a/15045e1c6a045c7269685f6f05501577',username:'gap🤖',}],[790,{uid:790,url:'/u/3410535f6a045c776763566f41193b20',avatar:'/a/3410535f6a045c776763566f41193b20',username:'macaodoll🤖',}],[7506,{uid:7506,url:'/u/3d115a1a6a045c70656a506f07003421',avatar:'/a/3d115a1a6a045c70656a506f07003421',username:'billly🤖',}],[708,{uid:708,url:'/u/6f7c451c6a045c77676a5e6f46506017',avatar:'/a/6f7c451c6a045c77676a5e6f46506017',username:'crackidz🤖',}],[12814,{uid:12814,url:'/u/623d78066a045d75686b526f07026014',avatar:'/a/623d78066a045d75686b526f07026014',username:'shebaoting🤖',}],]),related:[{title:'Claude 依然是编程最强, ChatGPT 跟 Gemini 在 Bash 这种常见语言的最基础的地方依然犯错',url:'/d/35316b0b6a045c77606a56754f5e606a347a0666',},{title:'悲!Gemini 2.5 pro exp 消失了',url:'/d/1f705d376a045c77606a5675405e676a0d35376a',},{title:'Gemini 最新更新的简直强的可怕',url:'/d/2e260b086a045c77606a56714450646a05742001',},{title:'Google的Gemini Robotics新模型发布,机器人更聪明、动作更精细',url:'/d/310d7d016a045c77606a5671445f626a1607161b',},{title:'哪个 大模型体验更好,大佬们,如果要进行大文件的翻译,逐句翻译,并标记处单词,短语,语法。。。',url:'/d/353e4a036a045c77606a567347586b6a092c2710',},],} 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")