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:8153,currentPage:1,targetPage:1,total:16,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:64,url:'/t/693157086a045c7164772a383a3c',name:'Grok',color:'#66BB6A',icon:'mdi-tag-heart',},],posts:[{id:105299,num:0,uid:14929,content:'https://www.iplaysoft.com/grok.html\u003Cbr\u003E亲测有效',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 01:18:53',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105300,num:1,uid:16816,content:'这不一定是终身啊,我也充了说是每月送,说不定活动哪天就给停了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 03:06:52',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105301,num:2,uid:3617,content:'旧闻,去年就有了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 08:23:11',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105302,num:3,uid:737,content:'已经开通,会场感谢。其实就是用个人数据换取额度,所以应该会长久\u003Cbr\u003E \u003Cimg src\u003D\"https://i.imgur.com/SHg1JYk.png\"\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 08:32:46',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105303,num:4,uid:7205,content:'充值了 但是没看到 share data.',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 09:07:13',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105304,num:5,uid:4179,content:'已经开通',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 09:21:16',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105305,num:6,uid:3912,content:'谢谢,撸到了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 09:29:35',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105306,num:7,uid:4591,content:'Share data 的没什么兴趣',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 09:36:14',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105307,num:8,uid:17889,content:'什么是 share data ?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 10:33:28',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105308,num:9,uid:17890,content:'你们用什么充值的,我总是失败',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 11:29:34',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105309,num:10,uid:9798,content:'这些虚拟信用卡平台还需要手机号注册,找的 dupay 可以邮箱注册,然后充值还是实名认证,靠谱吗',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 12:08:08',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105310,num:11,uid:2381,content:'查了下 xianmian.notion.site 上的记录,这个信息在 2 月 21 日就推送过了🤣',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 12:31:58',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105311,num:12,uid:9410,content:'全币卡可以用么',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 17:27:08',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105312,num:13,uid:9350,content:'2 月已充值,\u003Cbr\u003E但是,这不是终身吧',ipRegion:'',updatedByUid:0,createdAt:'2025-04-11 18:26:38',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105313,num:14,uid:14127,content:'实测招行 visa 可以',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 09:10:25',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:105314,num:15,uid:714,content:'成功了,谢谢 OP ,Grok 效果不错,可以实现 AI 自由了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-12 12:56:04',updatedAt:'2025-04-14 15:34:16',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[4179,{uid:4179,url:'/u/220359216a045c73616d5f6f4f2b310f',avatar:'/a/220359216a045c73616d5f6f4f2b310f',username:'superchijinpeng🤖',}],[3617,{uid:3617,url:'/u/1b2358356a045c74666b516f152f3d05',avatar:'/a/1b2358356a045c74666b516f152f3d05',username:'Tink🤖',}],[9798,{uid:9798,url:'/u/6804785b6a045c7e67635e6f472b230a',avatar:'/a/6804785b6a045c7e67635e6f472b230a',username:'fionasit007🤖',}],[714,{uid:714,url:'/u/153d42356a045c77676b526f25081625',avatar:'/a/153d42356a045c77676b526f25081625',username:'mauve🤖',}],[4591,{uid:4591,url:'/u/2f0341356a045c736563576f2e28620e',avatar:'/a/2f0341356a045c736563576f2e28620e',username:'bitmin🤖',}],[17889,{uid:17889,url:'/u/0d3e542a6a045d7068625f6f143f0716',avatar:'/a/0d3e542a6a045d7068625f6f143f0716',username:'kakalulin🤖',}],[9410,{uid:9410,url:'/u/0a3e46006a045c7e646b566f46583406',avatar:'/a/0a3e46006a045c7e646b566f46583406',username:'justwkj07🤖',}],[14929,{uid:14929,url:'/u/0f1d5e036a045d7369685f6f380a162a',avatar:'/a/0f1d5e036a045d7369685f6f380a162a',username:'Chentao1006🤖',}],[3912,{uid:3912,url:'/u/6e2b78596a045c74696b546f015d1575',avatar:'/a/6e2b78596a045c74696b546f015d1575',username:'wukaige🤖',}],[7205,{uid:7205,url:'/u/1f7f0b1e6a045c70626a536f212a3108',avatar:'/a/1f7f0b1e6a045c70626a536f212a3108',username:'chinni🤖',}],[16816,{uid:16816,url:'/u/337f481a6a045d71686b506f3b516b3d',avatar:'/a/337f481a6a045d71686b506f3b516b3d',username:'yousuck🤖',}],[737,{uid:737,url:'/u/39277b186a045c776769516f3c391628',avatar:'/a/39277b186a045c776769516f3c391628',username:'cat9life🤖',}],[2381,{uid:2381,url:'/u/1e7a445a6a045c756362576f11396276',avatar:'/a/1e7a445a6a045c756362576f11396276',username:'huguadao🤖',}],[17890,{uid:17890,url:'/u/007f4a1c6a045d706863566f273e1f20',avatar:'/a/007f4a1c6a045d706863566f273e1f20',username:'ColoThor🤖',}],[14127,{uid:14127,url:'/u/331f06236a045d736168516f33301b2e',avatar:'/a/331f06236a045d736168516f33301b2e',username:'xy19009188🤖',}],[9350,{uid:9350,url:'/u/18285a2e6a045c7e636f566f3f3f2008',avatar:'/a/18285a2e6a045c7e636f566f3f3f2008',username:'lucacham🤖',}],]),related:[{title:'ChatGPT、Grok 复制回答结果到 Word 经常格式会乱掉,尤其是表格,有没有现成的工具能一键导出到 Word?',url:'/d/383f68546a045c77606a567a45506b6a18306011',},{title:'Grok3 已支持 API 调用',url:'/d/132a5f546a045c77606a56754f5d656a24302700',},{title:'请教一下',url:'/d/62256a2f6a045c77606a567540506a6a5b0e651b',},{title:'求支持 Grok 多账号切换的工具',url:'/d/2a106a246a045c77606a5674445b606a1c282703',},{title:'grok3 非常频繁的弹 CF 认证',url:'/d/2d2b661d6a045c77606a56744559676a25222466',},{title:'grok3拼车',url:'/d/310b73346a045c77606a5677405f6a6a29702516',},{title:'grok冲5刀送150刀还能上车吗',url:'/d/02215a206a045c77606a5677445c6a6a5a746230',},{title:'grok3 api',url:'/d/0f3073006a045c77606a56774551666a1d7a3920',},{title:'Grok 每个月200人民币',url:'/d/3c1a472a6a045c77606a56714e59656a0b2c1c3f',},{title:'想问一下 Groq3 的 API 哪里有?',url:'/d/2c04455a6a045c77606a5671405b646a00176401',},{title:'🚗200刀chatGPT Pro,可触发深度,限时论坛福利全模型通用仅需99r/月,截止日期3.15,福利赠claude pro 3.7与grok3 super,下方可体验测试~',url:'/d/110b5a3d6a045c77606a5671415c6a6a0a302923',},{title:'Grok 充值领150刀还有效吗',url:'/d/0b0d67396a045c77606a56734350656a182f152b',},{title:'grok2能支持文件处理和生成图片吗?',url:'/d/297d571b6a045c77606a5673435f616a0304241e',},{title:'哪个 大模型体验更好,大佬们,如果要进行大文件的翻译,逐句翻译,并标记处单词,短语,语法。。。',url:'/d/353e4a036a045c77606a567347586b6a092c2710',},{title:'grok3 API什么时候才能出来啊',url:'/d/0f31701d6a045c77606a56724e5d656a5d012960',},],} 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")