摘要: 转载自 https://www.zhihu.com/question/532267866/answer/2506456679 我挺讨厌ajax这个词的,因为它名不副实。它的全称是Asynchronous JavaScript and XML。注意后面那个XML了吗?实际上现在的web开发交换数据都很 阅读全文
posted @ 2025-03-09 11:56 shanxin1954 阅读(5) 评论(0) 推荐(0)
摘要: 如果后台采用session,前端就需要用cookie存储并传递到后台,而移动端对cookie的支持不是很好,另外session在分布式系统中不适用。token就很灵活了,可以存储在cookie、localstorage、sessionstorage、url或者请求头 作者:专业宁罗斯 链接:http 阅读全文
posted @ 2025-03-09 11:18 shanxin1954 阅读(37) 评论(0) 推荐(0)
摘要: 有一个自己写的js库A,需要在vue项目B里调用。A还在开发中,经常修改不宜放在B里,加之别的vue项目也经常调用A。所以需要在vue项目里引用外部路径。 先修改vite.config.js: resolve: { alias: { '@': fileURLToPath(new URL('./src 阅读全文
posted @ 2025-03-09 01:01 shanxin1954 阅读(129) 评论(0) 推荐(0)
摘要: v-model在3.4升级了,旧的v-model是绑定到一个ref上,新的v-model是经过一个defineModel()。 看半天没看懂,继续用旧的v-model。 下面的代码,替换到vue默认生成的components/HelloWorld.vue里就行。 <script setup lang 阅读全文
posted @ 2025-03-08 22:35 shanxin1954 阅读(10) 评论(0) 推荐(0)
摘要: 在nginx里加上: location /api { proxy_pass http://localhost:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X- 阅读全文
posted @ 2025-03-08 14:50 shanxin1954 阅读(55) 评论(0) 推荐(0)
摘要: nginx理解http协议,因此可以用它充当半个Http服务器,直接处理并返回静态页面。 win10安装nginx,从官网直接下载,解压缩就可以用。 cd到nginx的根目录,直接运行start nginx。好奇windows下原来也有start这样的命令。 这时候浏览器访问localhost已经可 阅读全文
posted @ 2025-03-08 14:28 shanxin1954 阅读(163) 评论(0) 推荐(0)
摘要: 先下载安装nodejs,国内有一个cn网站,速度比较快(虽然总共只有30M)。windows的安装包已经变成msi了吗。 安装后就有了npm命令。 接下来安装vue了,其实说安装不准确,类似于,平时也不说"安装springboot"。 他们都是针对具体项目的手脚架,在具体创建一个项目时发生功能。 运 阅读全文
posted @ 2025-03-08 09:45 shanxin1954 阅读(46) 评论(0) 推荐(0)
摘要: 用eclipse写springboot程序,运行之后,服务线程会常驻。 eclipse本身的线程窗口找半天没找到,这时打开windows资源管理器,找到eclipse进程,点开,会发现下面展开了所有子线程,手动关闭所有的openjdk线程进行了。 阅读全文
posted @ 2025-03-08 09:30 shanxin1954 阅读(3) 评论(0) 推荐(0)
摘要: 一开始因为网络原因下载不了google的platform-tool,用的是adb minimal。 后来切换到platform-tool里的adb,发现push命令运行之后总是卡住。 原来是sdcard/xxx前面需要加/,写成/sdcard/xxx就好了。 不知道是adb版本的原因,还是minim 阅读全文
posted @ 2025-03-06 19:58 shanxin1954 阅读(141) 评论(0) 推荐(0)
摘要: 系统win10,wsl不知道是1还是2. 需要win10和wsl都安装adb,且版本一致。 wsl上apt安装的,1.41。 所以win10上也安装1.41版本的,https://dl.google.com/android/repository/platform-tools_r33.0.3-wind 阅读全文
posted @ 2025-03-06 17:01 shanxin1954 阅读(79) 评论(0) 推荐(0)