# 开发调优

**URL:** https://www.shiqidu.com/c/development/114.md

[最新](https://www.shiqidu.com/latest.md) · [类别](https://www.shiqidu.com/categories.md) · [标签](https://www.shiqidu.com/tags.md)

---

## [关于“开发调优”类别](https://www.shiqidu.com/t/topic/895)

<div class="topic-metadata">

**Author:** [@Leon](https://www.shiqidu.com/u/Leon)\
**回复:** 0

</div>

---

## [Vite 打包时丢掉 console 调用，页面上的合计金额跟着成了 undefined](https://www.shiqidu.com/t/topic/1846)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 29 日 10:16 UTC](https://www.shiqidu.com/t/topic/1846 "2026-10-29T10:16:32Z")

</div>

很多 Vite 项目的配置里都躺着一行 drop: \['console'\]，升到 8.x 以后则是 dropConsole: true，图的是线上控制台清净、包小一点。可写调试日志的时候，手很容易把正经逻辑塞进括号： console.lo…

---

## [IDEA 用了好几年再换 VS Code，最别扭的是提交代码和处理合并冲突](https://www.shiqidu.com/t/topic/1844)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 29 日 08:48 UTC](https://www.shiqidu.com/t/topic/1844 "2026-10-29T08:48:31Z")

</div>

IDEA 里改过的文件会自己落进默认的 Changes 变更列表。提交时在 Commit 工具窗口勾上要交的那几个、写好消息就行，Git 的暂存区基本见不着。JetBrains 的提交文档把暂存区写成一个要去设置里手动打开的选项（Versi…

---

## [三台电脑来回换着写，半截没提交的改动用 Git 怎么带过去？](https://www.shiqidu.com/t/topic/1843)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 29 日 08:23 UTC](https://www.shiqidu.com/t/topic/1843 "2026-10-29T08:23:32Z")

</div>

下班合上公司那台电脑时，工作区里多半还躺着一堆东西：改了一半的接口、新建后还没 git add 的测试文件、调试时临时打开的日志开关。回家开台式机想接着写，这些改动一个都不在；周末抱着笔记本出门，又得搬一次。家里、公司、笔记本之间倒腾半成品…

---

## [公网证书要缩到 47 天，Windows 服务器上那几个 IIS 站还在手动换证书](https://www.shiqidu.com/t/topic/1842)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 29 日 07:20 UTC](https://www.shiqidu.com/t/topic/1842 "2026-10-29T07:20:38Z")

</div>

拿日历数一下换证书的次数。2026 年 3 月 15 日以前签发的公网 TLS 证书最长能用 398 天，每年动一回就够。3 月 15 日起上限压到 200 天，一年起码换两次，现在新签的都在这一档。2027 年 3 月 15 日开始只给 …

---

## [Gemini API 新建的付费项目默认把请求存 55 天，要关得自己动手](https://www.shiqidu.com/t/topic/1841)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 29 日 06:46 UTC](https://www.shiqidu.com/t/topic/1841 "2026-10-29T06:46:54Z")

</div>

10 月 26 日以后新建的付费项目，不改设置的话，Gemini API 的调用记录会自己进 AI Studio 的 Logs 页。在那里点开任意一条记录，完整的 prompt、模型回复、前面几轮上下文都摆着。以前用 generateCon…

---

## [Nginx 配 PHP-FPM 的站，php2shell 补丁真能往后放吗？](https://www.shiqidu.com/t/topic/1840)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 29 日 05:54 UTC](https://www.shiqidu.com/t/topic/1840 "2026-10-29T05:54:24Z")

</div>

PHP-FPM 的子进程是复用的，一个 worker 忙完这个请求，接着处理下一个，中间不退出。php2shell 里的 CVE-2026-109619，php.net 公告的描述正好落在这条缝上：属于上一个请求的内部状态，在内存释放之后还…

---

## [网站从 www 用户挪进 Docker 以后进程变成了 root，被打穿时损失反而更大吗？](https://www.shiqidu.com/t/topic/1839)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 29 日 05:22 UTC](https://www.shiqidu.com/t/topic/1839 "2026-10-29T05:22:05Z")

</div>

老服务器上的站往容器里搬，流程一般挺顺：挑个官方镜像，COPY 代码，映射端口，起来就能访问。迁完再看进程，宿主机上原本归 www-data 的 PHP 或 Node，在容器里成了 uid 0，因为镜像没写 USER 时默认就用 root。…

---

## [全站 img 统一加了懒加载，Lighthouse 跑分 LCP 反倒更慢，首屏 banner 是不是不该碰？](https://www.shiqidu.com/t/topic/1833)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 28 日 12:47 UTC](https://www.shiqidu.com/t/topic/1833 "2026-10-28T12:47:08Z")

</div>

原生懒加载只要一个 loading="lazy" 属性，不必引库，也不用自己监听滚动。于是不少团队干脆在封装的 \<Image\> 组件里把它设成默认，或者让构建插件给每个 \<img\> 自动补上。下面的商品列表确实省了流量，可首屏那张大 ban…

---

## [Firefox 的 Local Mode 能替掉本地 serve 吗？Service Worker 那块文档没提](https://www.shiqidu.com/t/topic/1832)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 28 日 11:49 UTC](https://www.shiqidu.com/t/topic/1832 "2026-10-28T11:49:02Z")

</div>

有没有人已经把 Firefox 的 Local Mode 用进日常开发了？说的是 DevTools 选项面板里那个把本地文件夹映射成 https:// 地址的功能。Firefox 153 的发布说明把它列在 Developer 一栏，这个版…

---

## [前端接模型流式输出老拿到半截对象，是不是一开始就不该让它吐一个大对象？](https://www.shiqidu.com/t/topic/1831)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 28 日 11:15 UTC](https://www.shiqidu.com/t/topic/1831 "2026-10-28T11:15:51Z")

</div>

想让模型返回结构化结果，一边接收一边渲染成卡片列表，常见的写法是在提示词里要一个大对象，形如 {"cards":\[{...},{...}\]}。后端原样转发 token，前端每收到一块就试着 JSON.parse。结果就是，大部分时间拿到的都…

---

## [Flutter 都升到 3.47.8 了，商店里那个旧版 Android 包还能被中间人截吗](https://www.shiqidu.com/t/topic/1825)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 28 日 06:49 UTC](https://www.shiqidu.com/t/topic/1825 "2026-10-28T06:49:41Z")

</div>

已经装在用户手机和电脑上的那一版，证书校验逻辑在打包那一刻就编进去了，本地 SDK 升级只影响你下一次打出来的包。按官方公告的说法，这种旧包还是能被截。eMudhra 这次的事情里，Flutter 的 Android 和 Windows 包…

---

## [Claude Code 和 Codex 能顺手读到项目里的 .env，光写一条 deny 规则够不够？](https://www.shiqidu.com/t/topic/1824)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 28 日 05:53 UTC](https://www.shiqidu.com/t/topic/1824 "2026-10-28T05:53:23Z")

</div>

.env 里的东西一旦被 agent 读进上下文，就可能出现在它的回复、日志，甚至它新写的测试用例里。而让它在仓库里修 bug、跑测试时，为了弄清数据库怎么连，打开 .env 看一眼是很顺手的一步。在 CLAUDE.md 或 AGENTS.…

---

## [CLAUDE.md 里写明不许动的文件，Claude 还是照改，这种硬规矩该写在哪](https://www.shiqidu.com/t/topic/1822)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 28 日 04:22 UTC](https://www.shiqidu.com/t/topic/1822 "2026-10-28T04:22:44Z")

</div>

CLAUDE.md 里写一句「migrations/ 下已经上线的迁移文件不许改」，加粗、写 NEVER、挪到文件第一行，Claude 照样有一定概率去改。规则文件放哪、各家工具认哪个，站里这篇聊过；这里想聊的是写了它不听怎么办。 官方 m…

---

## [浏览器早就不认 eMudhra 那几张中间证书了，服务器上的 Node 和 pip 为什么还认](https://www.shiqidu.com/t/topic/1821)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 28 日 03:47 UTC](https://www.shiqidu.com/t/topic/1821 "2026-10-28T03:47:51Z")

</div>

eMudhra 那八张中间证书的私钥是 CA 自己生成坏的，谁都能从证书里把私钥算出来。Firefox、Chrome、微软、苹果前后几天都拉黑了，靠的是 CRLSet、OneCRL 这种只有浏览器和系统自己会读的分发渠道。可服务器上跑的 N…

---

## [Apache 上跑着 PHP 7.4 的老站，php2shell 官方不出新版了，迁完之前大家都在干嘛](https://www.shiqidu.com/t/topic/1820)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 28 日 02:52 UTC](https://www.shiqidu.com/t/topic/1820 "2026-10-28T02:52:44Z")

</div>

10 月 21 号 PHP 一口气发了 8.5.12、8.4.27、8.3.36、8.2.35 四个版本，修的是 CVE-2026-109618 和 CVE-2026-109619，就是外面叫 php2shell 的那两个，未认证远程代码执…

---

## [服务器释放后忘了删解析记录，域名会不会被别人的站顶上，还挂着我的备案号？](https://www.shiqidu.com/t/topic/1817)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 27 日 12:47 UTC](https://www.shiqidu.com/t/topic/1817 "2026-10-27T12:47:20Z")

</div>

DNS 里的一条 A 记录，内容就是一个 IPv4 地址。它不记得这个地址当初是谁买的，服务器没了它也不会自己失效。只要记录还在，浏览器就照着连过去，那边现在是谁的机器，DNS 不管。 放到云服务器上，这事就有点麻烦。设想一种挺常见的情况…

---

## [Node 18 的服务被扫出 CVE-2026-111497，运维说这季度升不了，这个 Brotli 洞能先怎么挡？](https://www.shiqidu.com/t/topic/1816)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 27 日 11:47 UTC](https://www.shiqidu.com/t/topic/1816 "2026-10-27T11:47:01Z")

</div>

安全扫描的工单挂到还在跑 Node 18 的服务上，编号 CVE-2026-111497，运维那边回得也很干脆：依赖太老，这个季度排不进升级窗口。可工单不会因为这句话自己关掉，至少得搞清楚这个洞打在哪，升级之前手上能做点什么。 这个编号是…

---

## [Codex 开了记忆以后，在新项目里老按别的仓库的规矩来，能不能只关一半](https://www.shiqidu.com/t/topic/1809)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年10 月 27 日 06:53 UTC](https://www.shiqidu.com/t/topic/1809 "2026-10-27T06:53:31Z")

</div>

比如在一个刚建的 Go 小服务里让 Codex 加配置加载，它把文件放进了 internal/conf/，还解释说是「沿用你之前的目录约定」。可这个约定是另一个仓库的，新项目里压根没有这个目录。这种情况多半是之前打开了 Codex 的本地记…

---

## [PHP基于Redis简单的分布式锁实现](https://www.shiqidu.com/t/topic/1757)

<div class="topic-metadata">

**Author:** [@yeqiu](https://www.shiqidu.com/u/yeqiu)\
**回复:** 0\
**最近更新：:** [2026 年8 月 11 日 12:51 UTC](https://www.shiqidu.com/t/topic/1757 "2026-08-11T12:51:01Z")

</div>

不考虑锁自动续期情况下的最小实现 /\*\* \* 加锁 \* \* @param string $lockKey \* @param int $ex \* @return string|false \*/ private function …

---

## [JavaScript 怎么判断鼠标现在还按着？用 MouseEvent.buttons](https://www.shiqidu.com/t/topic/1756)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年8 月 10 日 10:54 UTC](https://www.shiqidu.com/t/topic/1756 "2026-08-10T10:54:55Z")

</div>

mousedown 只能说明按键刚刚被按下。拖拽、绘图这类连续交互更关心的是另一件事：执行到某个 mousemove 时，主键到底还按没按着。 早期常见的办法是自己维护变量，在 mousedown 时加一，在 mouseup 时减一。问题…

---

## [JavaScript 最多保留两位小数，别忘了浮点数边界](https://www.shiqidu.com/t/topic/1754)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年8 月 10 日 10:51 UTC](https://www.shiqidu.com/t/topic/1754 "2026-08-10T10:51:16Z")

</div>

需求看起来很简单：1.7777 变成 1.78，9.1 仍然显示成 9.1，整数 10 也不要补成 10.00。 toFixed() 后转回数字 toFixed(2) 会返回字符串，而且会补齐两位小数。前面加一个一元 +，可以把结果转回数…

---

## [jQuery 加载目录里的全部图片，关键其实在服务器](https://www.shiqidu.com/t/topic/1751)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年8 月 10 日 10:50 UTC](https://www.shiqidu.com/t/topic/1751 "2026-08-10T10:50:28Z")

</div>

浏览器里的 JavaScript 不能直接遍历服务器文件夹。图片名称没有规律时，前端想把一个目录里的文件全部展示出来，需要服务器先返回目录列表，前端再从列表中筛选图片链接。 先确认目录 URL 能返回文件列表 下面这种写法依赖一个前提：请…

---

## [CodeIgniter 查询总是失败？把最后一条 SQL 打出来](https://www.shiqidu.com/t/topic/1750)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2026 年8 月 7 日 09:48 UTC](https://www.shiqidu.com/t/topic/1750 "2026-08-07T09:48:52Z")

</div>

在 CodeIgniter 老项目里排查数据库问题，经常会碰到这种情况：SQL 和绑定参数一起传给 query()，最后只拿到一个 false。继续盯着 $sql 变量看，未必能看出框架刚刚记录了哪条查询。 $query = $this-\>…

---

## [Guzzle 8.0.0 正式发布：PHP主流HTTP客户端重大破坏性版本升级](https://www.shiqidu.com/t/topic/1740)

<div class="topic-metadata">

**Author:** [@liswhe](https://www.shiqidu.com/u/liswhe)\
**回复:** 0\
**最近更新：:** [2026 年7 月 22 日 07:13 UTC](https://www.shiqidu.com/t/topic/1740 "2026-07-22T07:13:51Z")

</div>

\# Guzzle 8.0.0 正式发布：PHP主流HTTP客户端重大破坏性版本升级 Guzzle 8.0.0 重磅破坏性版本正式发布，本次更新以\*\*类型安全、安全加固、协议升级\*\*为核心，底层依赖同步升级：\`guzzlehttp/prom…

---

## [Navicat连接ssh报错 kex error : no match for method kex algos: server \[diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\], c](https://www.shiqidu.com/t/topic/891)

<div class="topic-metadata">

**Author:** [@Leon](https://www.shiqidu.com/u/Leon)\
**回复:** 0\
**最近更新：:** [2026 年5 月 16 日 15:30 UTC](https://www.shiqidu.com/t/topic/891 "2026-05-16T15:30:01Z")

</div>

如题，换了新电脑之后使用Naivat连接远程数据库报错如下，macOS系统版本、系统openSsh版本、Navicat版本都和原电脑一直的情况下仍旧报错 Navicat连接ssh报错 kex error : no match for me…

---

## [百度地图初加载中心点左移，没有居中](https://www.shiqidu.com/t/topic/881)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 1\
**最近更新：:** [2026 年3 月 5 日 08:14 UTC](https://www.shiqidu.com/t/topic/881 "2026-03-05T08:14:26Z")

</div>

问题：调用百度地图api后，加载百度地图是，给定的中心点左移了。 原因：地图div刚开始是隐藏的，地图进行初始化时，默认获取的宽高度为0（存疑）； 解决方法：设置一个延时加载，完美解决问题； 代码： setTimeout(funct…

---

## [MySQL更新json字段，添加key。](https://www.shiqidu.com/t/topic/887)

<div class="topic-metadata">

**Author:** [@Leon](https://www.shiqidu.com/u/Leon)\
**回复:** 0\
**最近更新：:** [2026 年1 月 21 日 03:29 UTC](https://www.shiqidu.com/t/topic/887 "2026-01-21T03:29:54Z")

</div>

如果我的order表，extend\_info字段类型是text，但是存储的内容是json格式的字符串，且字段允许为null，我想给extend\_info字段新增一个key，fromStockMerge，值为1。 { "a": "1…

---

## [BitLocker启用，辅助邮箱被改，找回Windows账号的艰难历程](https://www.shiqidu.com/t/topic/886)

<div class="topic-metadata">

**Author:** [@danton](https://www.shiqidu.com/u/danton)\
**回复:** 0\
**最近更新：:** [2026 年1 月 21 日 03:05 UTC](https://www.shiqidu.com/t/topic/886 "2026-01-21T03:05:02Z")

</div>

问题 微软账号被盗，导致笔记本电脑的人脸失效，而且pin也不记得了，无法解锁进入系统。主要问题如下： 1. 数据比较重要，万不得已不考虑损伤数据的解决方案 2. 系统使用微软账号，未设置本地账号 3. 系统默认开启BitLocker…

---

## [Linux基础-文件管理](https://www.shiqidu.com/t/topic/882)

<div class="topic-metadata">

**Author:** [@shiqidu\_editor](https://www.shiqidu.com/u/shiqidu_editor)\
**回复:** 0\
**最近更新：:** [2025 年11 月 8 日 17:12 UTC](https://www.shiqidu.com/t/topic/882 "2025-11-08T17:12:01Z")

</div>

一、文件管理 \[TOC\] 目前服务器端的主流文件系统是：ext4与xfs； df -T 查看磁盘的格式化的格式，主流一般是 xfs 和ext4，系统盘默认是xfs，后续添加数据盘尽量也是xfs格式这样统一比较好，也方便写脚本批量挂盘。 …

[下一页](https://www.shiqidu.com/c/development/114.md?page=1)
