index.html 10 KB

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