index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>猿人学面试</title>
  7. <link rel="stylesheet" href="css/index.css">
  8. <script src="js/axios.min.js"></script>
  9. <script src="js/vue.js"></script>
  10. </head>
  11. <style>
  12. .banner{
  13. margin: 16px auto;
  14. }
  15. </style>
  16. <body>
  17. <section id="app">
  18. <div style="background-color: #FDC606;box-shadow: 0px 0px 4px 0 rgba(0,0,0,.5);">
  19. <header>
  20. <div class="left_nav">
  21. <img @click="show=!show" class="phone" width="30" src="img/menu.png" alt="">
  22. <img class="logo" src="img/logo.png" alt="logo">
  23. </div>
  24. <div class="nav">
  25. <a class="act" href="/index.html">主页</a>
  26. <a href="https://match.yuanrenxue.cn/" target="_blank">爬虫逆向比赛</a>
  27. <a href="https://match.yuanrenxue.cn/" target="_blank">采集进阶课程</a>
  28. <a href="https://tool.yuanrenxue.cn/" target="_blank">采集分析工具</a>
  29. <a href="https://appmatch.yuanrenxue.cn/" target="_blank">APP题目</a>
  30. <a href="https://www.yuanrenxue.cn/" target="_blank">关于猿人学</a>
  31. </div>
  32. <div class="login">
  33. <div class="pc">
  34. <!-- <img width="30px" src="img/logo.jpg" alt="logo"> -->
  35. <div v-if="userInfo" class="menu">
  36. {{userInfo.name}}
  37. <ul>
  38. <li><a href="/record.html">我的刷题记录</a></li>
  39. <li @click="logout"><a>退出登录</a></li>
  40. </ul>
  41. </div>
  42. <a v-else href="/login.html">请先登录</a>
  43. </div>
  44. <div class="phone">
  45. <span v-if="userInfo">{{userInfo.name}}</span>
  46. <a v-else href="/login.html">请先登录</a>
  47. </div>
  48. </div>
  49. </header>
  50. </div>
  51. <transition name="slide">
  52. <div class="slide" v-if="show">
  53. <a class="act" href="/index.html">主页</a>
  54. <a href="https://match.yuanrenxue.cn/" target="_blank">爬虫逆向比赛</a>
  55. <a href="https://match.yuanrenxue.cn/" target="_blank">采集进阶课程</a>
  56. <a href="https://tool.yuanrenxue.cn/" target="_blank">采集分析工具</a>
  57. <a href="https://appmatch.yuanrenxue.cn/" target="_blank">APP题目</a>
  58. <a href="https://www.yuanrenxue.cn/" target="_blank">关于猿人学</a>
  59. <a v-if="userInfo" href="/record.html">我的刷题记录</a>
  60. <a v-if="userInfo" @click="logout">退出登录</a>
  61. </div>
  62. </transition>
  63. <div class="content index" >
  64. <div class="left" >
  65. <div class="banner">
  66. <img width="100%" height="100%" :src="img[0]" alt="">
  67. </div>
  68. </div>
  69. <div class="right">
  70. <div class="banner">
  71. <img width="100%" height="100%" :src="img[1]" alt="">
  72. </div>
  73. </div>
  74. <div class="left" v-if="list.length>0">
  75. <div class="part">
  76. <h1 class="title"><span>JS逆向面试题</span></h1>
  77. <ul class="list">
  78. <li v-for="item in list[0].list">
  79. <div>
  80. <a :href="'/detail.html?cat=js&id='+item.interviewId">{{item.name}}</a>
  81. </div>
  82. </li>
  83. </ul>
  84. <a href="/list.html?cat=js" class="more">更多JS逆向面试题</a>
  85. </div>
  86. <div class="part">
  87. <h1 class="title"><span>安卓逆向面试题</span></h1>
  88. <ul class="list">
  89. <li v-for="item in list[1].list">
  90. <div>
  91. <a :href="'/detail.html?cat=android&id='+item.interviewId">{{item.name}}</a>
  92. </div>
  93. </li>
  94. </ul>
  95. <a href="/list.html?cat=android" class="more">更多安卓逆向面试题</a>
  96. </div>
  97. <div class="part">
  98. <h1 class="title"><span>爬虫面试题</span></h1>
  99. <ul class="list">
  100. <li v-for="item in list[2].list">
  101. <div>
  102. <a :href="'/detail.html?cat=crawler&id='+item.interviewId">{{item.name}}</a>
  103. </div>
  104. </li>
  105. </ul>
  106. <a href="/list.html?cat=crawler" class="more">更多爬虫面试题</a>
  107. </div>
  108. </div>
  109. <div class="right">
  110. <div class="part">
  111. <h2 class="sec_title"><span>面试排行榜</span> <a href="">更多</a></h2>
  112. <ul class="list list_100">
  113. <li v-for="item in top"><a :href="'/record.html?cid='+item.cid">{{item.cname}}</a><span>{{item.count}}</span></li>
  114. </ul>
  115. </div>
  116. <div class="part">
  117. <h2 class="sec_title"><span>贡献面试题</span></h2>
  118. <form class="form">
  119. <input v-model="name" type="text" placeholder="面试题目">
  120. <textarea v-model="content"></textarea>
  121. <button type="button" @click="post">提交</button>
  122. </form>
  123. </div>
  124. </div>
  125. </div>
  126. <footer>
  127. <ul>
  128. <li>
  129. <b>爬虫比赛</b> <br>
  130. <a href="https://appmatch.yuanrenxue.cn/" target="_blank">APP题目</a>
  131. <a href="https://match.yuanrenxue.cn/" target="_blank">爬虫逆向比赛</a>
  132. <a href="https://tool.yuanrenxue.cn/" target="_blank">采集分析工具</a>
  133. </li>
  134. <li>
  135. <b>爬虫课程</b> <br>
  136. <a href="https://shop45147253.m.youzan.com/wscgoods/detail/2okabph85ypv1?banner_id=f.86209928~goods.2~1~rVebiaQ5&alg_id=0&slg=0&components_style_layout=0&reft=1744878857227&spm=f.86209928&sf=wx_sm" target="_blank">爬虫逆向进阶课</a>
  137. <a href="https://shop45147253.m.youzan.com/wscgoods/detail/2xli2kj7ku3a5zk?banner_id=f.86209928~goods.2~2~lWrtebiJ&alg_id=0&slg=0&components_style_layout=0&reft=1744878880491&spm=f.86209928&sf=wx_sm" target="_blank">反爬&风控对抗课</a>
  138. <a href="https://shop45147253.m.youzan.com/wscgoods/detail/361rmliyhfwr184?banner_id=f.86209928~goods.2~3~25r4gDL2&alg_id=0&slg=0&components_style_layout=0&reft=1744878921640&spm=f.86209928&sf=wx_sm" target="_blank">0基础+爬虫逆向课</a>
  139. </li>
  140. <li>
  141. <b>关于猿人学</b> <br>
  142. <a href="https://www.yuanrenxue.cn/tricks" target="_blank">Python技术杂谈</a>
  143. <a href="https://www.yuanrenxue.cn/earn-money" target="_blank">Python爬虫挣钱</a>
  144. </li>
  145. <li class="contact" style="display: flex;line-height: 30px;">
  146. <img style="margin-right: 10px;" width="100" height="100" src="img/wx.jpg" alt="">
  147. 扫一扫加我微信 <br>
  148. 备注面试题 <br>
  149. 拉你进面试交流群
  150. </li>
  151. </ul>
  152. <p>成都老猿智能科技有限公司Copyright @ 2025 猿人学面试 蜀ICP备2022000052号-2</p>
  153. </footer>
  154. </section>
  155. <script src="js/public.js"></script>
  156. <script>
  157. const { createApp } = Vue;
  158. createApp({
  159. data() {
  160. return {
  161. show:0,
  162. list:[],
  163. img:[],
  164. top:[],
  165. name:'',
  166. content:'',
  167. userInfo:{}
  168. }
  169. },
  170. created(){
  171. const userInfo = JSON.parse(localStorage.getItem('userInfo'));
  172. this.userInfo = userInfo;
  173. this.getData();
  174. },
  175. methods:{
  176. logout(){
  177. localStorage.removeItem('userInfo');
  178. localStorage.removeItem('token');
  179. this.userInfo = null;
  180. },
  181. getData(){
  182. axios.get(url+'/api/yrx/que/top').then(res=>{
  183. this.list = res.data.data;
  184. })
  185. axios.get(url+'/api/yrx/banner/list?position=index_left').then(res=>{
  186. this.img[0] = res.data.data[0].img;
  187. })
  188. axios.get(url+'/api/yrx/banner/list?position=index_right').then(res=>{
  189. this.img[1] = res.data.data[0].img;
  190. })
  191. axios.get(url+'/api/yrx/que/user/top').then(res=>{
  192. this.top = res.data.data;
  193. })
  194. },
  195. post(){
  196. const token = localStorage.getItem('token'); // 获取token
  197. if(!token){
  198. window.location.href="/login.html";
  199. return;
  200. }
  201. if (!this.name || !this.content) {
  202. alert('面试题目和内容不能为空');
  203. return;
  204. }
  205. axios.post(url+'/api/yrx/que/user/post', { name: this.name, content: this.content }, {
  206. headers: {
  207. 'Authorization': `${token}` // 添加token到header
  208. }
  209. })
  210. .then(res => {
  211. if(res.data.code === 0){
  212. alert('提交成功');
  213. this.name = '';
  214. this.content = '';
  215. }
  216. })
  217. .catch(err => {
  218. alert('提交失败,请重试');
  219. console.error(err);
  220. });
  221. }
  222. }
  223. }).mount('#app');
  224. </script>
  225. </body>
  226. </html>