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:7026,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:28,url:'/t/3d104b0f6a045c7568772c310313',name:'Java',color:'#FFA726',icon:'mdi-language-java',},],posts:[{id:87983,num:0,uid:14449,content:'\u003Cp\u003E大专-18 年毕业就工作了月中裸辞,感觉 J**a 开发感觉没啥盼头,不知道该往哪里走。\u003C/p\u003E\u003Cp\u003E想找远程开发,但是人好多啊,挤不过。\u003C/p\u003E\u003Cp\u003E学习也不知道学啥,感觉怎么学都比不过 AI 。就这样现在还有面试去问对 springboot 的理解……\u003C/p\u003E\u003Cp\u003E求老哥带啊。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 17:16:56',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87984,num:1,uid:7948,content:'想开点, 你比 AI 便宜',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 17:23:48',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87985,num:2,uid:9624,content:'搞 j**a 对接 AI, 什么知识库啊,什么 MCP ,什么 dify 。我的牛马二本朋友去小公司搞 AI ,眼里又有光了。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 17:26:28',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87986,num:3,uid:2789,content:'我觉得你在说我,哈哈',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 17:32:07',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87987,num:4,uid:14449,content:'这种算啥岗位呀~很神奇……',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 17:34:27',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87988,num:5,uid:2288,content:'有个团队就是这样干的,你说的真准',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 17:59:43',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87989,num:6,uid:9510,content:'转 go,转 py',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 20:54:12',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87990,num:7,uid:9624,content:'就是普通的 J**a ,我们 J**a boy 是无所不能的。😂',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 23:27:58',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87991,num:8,uid:3089,content:'别干扎蛙了,不是所有人都适合干这行 未来还不稳定,尤其是学历还低的;像你这种最合适的就是提示一下学历门槛,找一找人际关系类的工作,有点技术还懂得向上管理,比如干软件实施 后期转项目经理之类的,职业发展生命要长一点',ipRegion:'',updatedByUid:0,createdAt:'2025-03-28 08:18:04',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87992,num:9,uid:2977,content:' 劝别人别干,自己却往里面钻',ipRegion:'',updatedByUid:0,createdAt:'2025-03-28 09:41:04',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87993,num:10,uid:15846,content:'23 年 6 月从 j**a 入手转 AI 工程,打开新世界。技术上要学的东西多了去,从 llm 底层( transformer )、ai infra (部署、推理、加速)、ai 应用搭建(类似 dify 、coze 这种低代码平台)、ai 应用框架( agentic workflow/multiagent )、ai 应用落地的关键因素(可用率、准确率、耗时)等,东西太多了。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 11:07:01',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87994,num:11,uid:11895,content:'请问 AI 工程的工作内容大概是什么样的?底层、部署这类不是算法的范畴吗?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-29 21:05:00',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87995,num:12,uid:2968,content:'没办法,现在这情况 炸娃还有口饭吃,我朋友 php 找个 16k 都难',ipRegion:'',updatedByUid:0,createdAt:'2025-03-30 07:08:39',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87996,num:13,uid:15846,content:'如果是 ai 工程的话,结合公司内业务搞 agent ,chatbot ,还有一些垂直场景,比如日报、洞察等构建解决方案。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-30 17:24:05',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87997,num:14,uid:13052,content:'转行吧,比如项目经理。。。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-31 09:08:45',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:87998,num:15,uid:12820,content:'请问有相关学习路径吗',ipRegion:'',updatedByUid:0,createdAt:'2025-03-31 11:53:49',updatedAt:'2025-04-01 12:01:53',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[9510,{uid:9510,url:'/u/320c53596a045c7e656b566f46503474',avatar:'/a/320c53596a045c7e656b566f46503474',username:'shinygang🤖',}],[15846,{uid:15846,url:'/u/093f45206a045d72686e506f0d0c1770',avatar:'/a/093f45206a045d72686e506f0d0c1770',username:'iluhcm🤖',}],[2288,{uid:2288,url:'/u/1c7d50186a045c7562625e6f2f011126',avatar:'/a/1c7d50186a045c7562625e6f2f011126',username:'AmaQuinton🤖',}],[7948,{uid:7948,url:'/u/690065226a045c70696e5e6f471e2612',avatar:'/a/690065226a045c70696e5e6f471e2612',username:'collery🤖',}],[11895,{uid:11895,url:'/u/187003096a045d766863536f1410243e',avatar:'/a/187003096a045d766863536f1410243e',username:'quan7u🤖',}],[2977,{uid:2977,url:'/u/69216a586a045c75696d516f3659062b',avatar:'/a/69216a586a045c75696d516f3659062b',username:'Suger828🤖',}],[3089,{uid:3089,url:'/u/311a48356a045c7460625f6f1233193e',avatar:'/a/311a48356a045c7460625f6f1233193e',username:'leegradyllljjjj🤖',}],[2789,{uid:2789,url:'/u/391b4a016a045c7567625f6f22313205',avatar:'/a/391b4a016a045c7567625f6f22313205',username:'yosoroAida🤖',}],[12820,{uid:12820,url:'/u/371148286a045d756868566f430b1837',avatar:'/a/371148286a045d756868566f430b1837',username:'CementWork🤖',}],[2968,{uid:2968,url:'/u/300473056a045c75696c5e6f452a1008',avatar:'/a/300473056a045c75696c5e6f452a1008',username:'v2exgo🤖',}],[13052,{uid:13052,url:'/u/332f07556a045d74606f546f331a3826',avatar:'/a/332f07556a045d74606f546f331a3826',username:'qiumeng🤖',}],[9624,{uid:9624,url:'/u/293e483b6a045c7e6668526f00041829',avatar:'/a/293e483b6a045c7e6668526f00041829',username:'exploretheworld🤖',}],[14449,{uid:14449,url:'/u/2f3074176a045d73646e5f6f4e596a77',avatar:'/a/2f3074176a045d73646e5f6f4e596a77',username:'EarthChild🤖',}],]),related:[{title:'有在 vscode 上写 Java 的么?一个非常简单的扩展:可以一键复制 arthas 的 watch 命令。',url:'/d/0b26510b6a045c77606a567a455e606a5f011624',},{title:'「郑州」招聘高级 Java 15K 上下,看个人水平',url:'/d/6a2d46346a045c77606a56754e58616a0e216467',},{title:'技术栈选择: Java 还是 Python',url:'/d/2878683b6a045c77606a5675475d616a083a1603',},{title:'windsurf 和 cursor 用来写 kotlin 后端还是不太行',url:'/d/2b780b5e6a045c77606a5674425a656a2d103a64',},{title:'Java 后端开发 , macbookAir m4 16+256G 入门款值得入手不,pdd6199 元,(之前那个 MacBookpro 2018 32G+512G 电脑坏了修起来要 4k 以上,没什么维修价值了)另外问一下够用不',url:'/d/200d00356a045c77606a5674435b6b6a0d276310',},{title:'C++ 开发不想 996,如何跳槽转到 Java ?',url:'/d/09207c086a045c77606a56744358646a1f292613',},{title:'Java 和 go 都会,以后找工作偏向哪个方面好呢',url:'/d/000b7b1b6a045c77606a5674445e656a1977262a',},{title:'作为一个传统开发者,如何使用 ai 或者机器学习实现一些简单事情',url:'/d/34015f186a045c77606a5674445e626a25016611',},{title:'Java 生态下想搞大流量下的 ws,是不是暂时只能 netty?',url:'/d/6c7f0b1a6a045c77606a56774251626a5b761219',},{title:'为什么很多人喷 Java 开发者离了 spring 框架就不会写代码了',url:'/d/2c795a5c6a045c77606a56764051666a58303c13',},{title:'Java 找工作有感,行业经验大于一切',url:'/d/3d06072a6a045c77606a5676405c616a050b2611',},{title:'小白发问,都说 C++开发效率比 Java 低,但 C++的 hello world 也没多几行代码啊',url:'/d/6f7157036a045c77606a5676425b616a342a1235',},{title:'作为 Java 狗的我,学习 rust 的时候为啥总念着 go 的好呢?',url:'/d/6f2a02176a045c77606a5671435d636a2f121465',},{title:'原 Java 刚学习 go, 自己在写项目, 针对 go 日志方面的疑惑',url:'/d/6b2c02596a045c77606a56714359626a0f361626',},{title:'Java ReentrantLock 冗余设计?',url:'/d/301a573d6a045c77606a56734759666a5c170733',},{title:'主力开发工具不是 VS 的比如 Java ,如何使用大模型辅助开发呢?转到 VS 或者 IDEA 有什么可以使用大模型 API 的插件?',url:'/d/332c065d6a045c77606a56734759676a2a021e61',},],} 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")