<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>纸盒</title><link>//www.nswlp.cn/</link><description></description></channel><item><title>Navicat for mysql 注册Navicat_Keygen_Patch_v5.6_By_DFoX使用方法</title><link>//www.nswlp.cn/post/356.html</link><description>&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;     &quot;&gt;在Nacicat官网下载Navicat for mysql 之后安装成功之后&lt;/p&gt;&lt;ul style=&quot; margin-bottom: 24px;    font-size: 16px;    color: rgba(0, 0, 0, 0.75);  &quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;将Navicat_Keygen_Patch_v5.6_By_DFoX 复制到Navicat for mysql的安装目录下&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Navicat_Keygen_Patch_v5.6_By_DFoX 链接：https://pan.baidu.com/s/1fUNyyEmHKj5NnR9acrwPsA&lt;br/&gt;提取码：lu5p&lt;br/&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2026/02/ac985c4964c4f73346e78f343463caab.png&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;  margin: 24px 0px; max-width: 100%;   &quot;/&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;在Navicat关闭的情况下,运行该注册程序&lt;br/&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2026/02/3f558cfa8dff223e427272db3c91f18e.png&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;  margin: 24px 0px; max-width: 100%;   &quot;/&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;点击patch 弹出窗口，显示为下图就是成功了&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;     &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2026/02/3cae611b4263a1d2f53d855abd5bf33b.png&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;  margin: 0px; max-width: 100%;   &quot;/&gt;&lt;/p&gt;&lt;ul style=&quot; margin-bottom: 24px;    font-size: 16px;    color: rgba(0, 0, 0, 0.75);  &quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;点击Generate—&amp;gt;出现序列码—&amp;gt;点击Copy&lt;br/&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2026/02/33ecc825391d3fa436f750fedc034f65.png&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;  margin: 24px 0px; max-width: 100%;   &quot;/&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;打开navicat,第一次打开的时候点击注册，然后把刚才copy的序列码复制进去，点击激活。&lt;br/&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2026/02/6f3bda95dec42af23229e5eef32253c1.png&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;  margin: 24px 0px; max-width: 100%;   &quot;/&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;选择手动激活&lt;br/&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2026/02/ec3797869524104f4db65e21133e4de4.png&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;  margin: 24px 0px; max-width: 100%;   &quot;/&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;然后会生成一大串请求码,复制请求码到注册机中的Request Code中，点击Activation Code下的generate，生成激活码&lt;br/&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2026/02/e5b00d4c20371d059904bf6a57d88b77.png&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;  margin: 24px 0px; max-width: 100%;   &quot;/&gt;&lt;br/&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2026/02/53d401a4cc3b2f1ad96635c4a1497512.png&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;  margin: 24px 0px; max-width: 100%;   &quot;/&gt;&lt;br/&gt;点击generate，生成激活码会自动复制&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;     &quot;&gt;点击激活！！！即可&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sun, 01 Feb 2026 15:16:52 +0800</pubDate></item><item><title>关于Nest.js 现代后端开发的一些指南</title><link>//www.nswlp.cn/post/355.html</link><description>&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第一部分：认识Nest.js的「骨架」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;&quot;&gt;1.1 框架定位&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;    &quot;&gt;想象你要盖房子：&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;Express/Fastify = 给你砖头和水泥（基础工具）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;Nest = 预制钢结构框架+施工图纸（企业级架构方案）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;      &quot;&gt;核心价值：用Angular风格的架构解决 Node.js 后端松散问题&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;1.2 核心三件套&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;典型结构示例
@Module({
&amp;nbsp;&amp;nbsp;controllers:&amp;nbsp;[CatsController],&amp;nbsp;&amp;nbsp;//&amp;nbsp;接待处：处理请求
&amp;nbsp;&amp;nbsp;providers:&amp;nbsp;[CatsService],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;工人：实际干活的
&amp;nbsp;&amp;nbsp;imports:&amp;nbsp;[DatabaseModule]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;工具箱：其他模块的工具
})
export&amp;nbsp;class&amp;nbsp;CatsModule&amp;nbsp;{}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;1.3 依赖注入（DI）&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;场景：咖啡店点单&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;传统方式：你自己去后厨找牛奶、咖啡豆（紧密耦合）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;DI模式：告诉服务员「我要拿铁」，后厨自动配齐（解耦）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;代码体现：&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;错误示范：直接实例化（自己冲进后厨）
classCatController{
constructor(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.catService&amp;nbsp;=newCatService();//&amp;nbsp;耦合性强
}
}
//&amp;nbsp;正确做法：声明依赖（优雅点单）
@Controller()
classCatController{
constructor(privatereadonly&amp;nbsp;catService:&amp;nbsp;CatService){}//&amp;nbsp;Nest自动注入
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;1.4 第一个Hello World（动手验证）&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;步骤分解：&lt;/p&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;安装脚手架：&lt;code style=&quot;  &quot;&gt;npm i -g @nestjs/cli&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;创建项目：&lt;code style=&quot;  &quot;&gt;nest new hello-world&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;核心文件结构：&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;src/
├─&amp;nbsp;main.ts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;程序入口（点火装置）
├─&amp;nbsp;app.module.ts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;主模块（大脑）
└─&amp;nbsp;app.controller.ts&amp;nbsp;//&amp;nbsp;路由控制器（接线员）&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;修改app.controller.ts：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;@Get()
getHello():&amp;nbsp;string&amp;nbsp;{
&amp;nbsp;&amp;nbsp;return&amp;nbsp;&amp;#39;你好，这里是自定义问候语！&amp;#39;;&amp;nbsp;//&amp;nbsp;修改官方默认响应
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;1.5 典型目录结构&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;以下是一份典型的Nest.js项目目录结构及注释说明，适用于中大型项目开发：&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;├──&amp;nbsp;src/
│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;common/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;通用共享模块
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;decorators/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;自定义装饰器（如@Roles）
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;filters/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;异常过滤器（全局异常处理）
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;interceptors/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;拦截器（响应格式化/日志）
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;└──&amp;nbsp;middleware/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;全局中间件（CORS/日志）
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│
│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;config/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;配置相关
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;app.config.ts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;应用基础配置
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;└──&amp;nbsp;env/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;环境配置校验
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│
│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;database/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;数据库模块
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;entities/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;TypeORM实体类
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;migrations/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;数据库迁移脚本
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;└──&amp;nbsp;database.module.ts
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│
│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;auth/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;认证授权模块
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;strategies/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;Passport策略（JWT/Local）
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;guards/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;守卫（角色验证）
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;dto/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;数据传输对象（登录/注册）
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;└──&amp;nbsp;auth.module.ts
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│
│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;user/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;用户模块
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;user.controller.ts
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;user.service.ts
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;dto/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;DTO（创建/更新用户）
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│&amp;nbsp;&amp;nbsp;&amp;nbsp;└──&amp;nbsp;user.module.ts
│&amp;nbsp;&amp;nbsp;&amp;nbsp;│
│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;app.module.ts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;根模块
│&amp;nbsp;&amp;nbsp;&amp;nbsp;└──&amp;nbsp;main.ts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;应用入口文件
│
├──&amp;nbsp;test/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;测试目录
│&amp;nbsp;&amp;nbsp;&amp;nbsp;├──&amp;nbsp;e2e/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;端到端测试
│&amp;nbsp;&amp;nbsp;&amp;nbsp;└──&amp;nbsp;unit/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;单元测试
│
├──&amp;nbsp;public/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;静态资源目录
├──&amp;nbsp;uploads/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;文件上传存储目录
│
├──&amp;nbsp;.env&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;本地环境变量
├──&amp;nbsp;.env.prod&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;生产环境变量
├──&amp;nbsp;docker-compose.yml&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;Docker容器编排
├──&amp;nbsp;Dockerfile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;Docker构建配置
├──&amp;nbsp;nest-cli.json&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;Nest&amp;nbsp;CLI配置
├──&amp;nbsp;package.json&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;依赖管理
└──&amp;nbsp;tsconfig.json&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;TypeScript配置&lt;/pre&gt;&lt;hr style=&quot;       border-bottom: 1px solid rgb(204, 204, 204);     font-size: 16px;  &quot;/&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第二部分：控制器——你的业务「接线员」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;2.1 控制器的本质&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;想象你有一个快递分拣中心：&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;包裹（请求）进入传送带&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;分拣机器人（控制器）根据：&lt;/p&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: circle;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;目的地地址（路由路径）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;包裹类型（HTTP方法）&lt;br style=&quot;  &quot;/&gt;决定送到哪个处理区（处理方法）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;2.2 创建业务控制器&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;#&amp;nbsp;命令行生成控制器（最佳实践）
nest&amp;nbsp;generate&amp;nbsp;controller&amp;nbsp;user&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;生成文件结构：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;src/
└─&amp;nbsp;user/
&amp;nbsp;&amp;nbsp;&amp;nbsp;├─&amp;nbsp;user.controller.ts
&amp;nbsp;&amp;nbsp;&amp;nbsp;├─&amp;nbsp;user.service.ts
&amp;nbsp;&amp;nbsp;&amp;nbsp;└─&amp;nbsp;user.module.ts&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;2.3 路由方法实战（Restful风格）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;@Controller(&amp;#39;users&amp;#39;)//&amp;nbsp;基础路径&amp;nbsp;/users
exportclassUserController{
//&amp;nbsp;GET&amp;nbsp;/users/profile
@Get(&amp;#39;profile&amp;#39;)
getProfile(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;#39;用户张三的个人页面&amp;#39;;
}
//&amp;nbsp;POST&amp;nbsp;/users/register
@Post(&amp;#39;register&amp;#39;)
registerUser(@Body()&amp;nbsp;userData:any){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(&amp;#39;收到注册数据:&amp;#39;,&amp;nbsp;userData);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return{&amp;nbsp;success:true,&amp;nbsp;userId:123};
}
//&amp;nbsp;动态路由参数&amp;nbsp;/users/orders/789
@Get(&amp;#39;orders/:orderId&amp;#39;)
getOrder(@Param(&amp;#39;orderId&amp;#39;)&amp;nbsp;orderId:string){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return`查询订单${orderId}的详细信息`;
}
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;2.4 参数获取三大招&lt;/h5&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;路径参数&lt;/span&gt;：&lt;code style=&quot;  &quot;&gt;@Param(&amp;#39;id&amp;#39;)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;GET&amp;nbsp;/product/iphone-15
@Get(&amp;#39;:model&amp;#39;)
getProduct(@Param(&amp;#39;model&amp;#39;)&amp;nbsp;model:&amp;nbsp;string)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;return&amp;nbsp;`正在查询${model}型号`;
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;     font-size: 16px;  &quot;&gt;查询参数&lt;/span&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;：&lt;/span&gt;&lt;code style=&quot;    font-size: 16px;  &quot;&gt;@Query()&lt;/code&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;GET&amp;nbsp;/search?q=nestjs&amp;amp;page=2
@Get(&amp;#39;search&amp;#39;)
search(@Query()&amp;nbsp;params:&amp;nbsp;{&amp;nbsp;q:&amp;nbsp;string;&amp;nbsp;page:&amp;nbsp;number&amp;nbsp;})&amp;nbsp;{
&amp;nbsp;&amp;nbsp;return&amp;nbsp;`搜索关键词：${params.q}，第${params.page}页`;
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;     font-size: 16px;  &quot;&gt;请求体&lt;/span&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;：&lt;/span&gt;&lt;code style=&quot;    font-size: 16px;  &quot;&gt;@Body()&lt;/code&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;POST&amp;nbsp;/login
@Post(&amp;#39;login&amp;#39;)
login(@Body()&amp;nbsp;credentials:&amp;nbsp;{&amp;nbsp;username:&amp;nbsp;string;&amp;nbsp;password:&amp;nbsp;string&amp;nbsp;})&amp;nbsp;{
&amp;nbsp;&amp;nbsp;//&amp;nbsp;实际开发中这里会调用验证服务
&amp;nbsp;&amp;nbsp;return&amp;nbsp;`用户${credentials.username}正在尝试登录`;
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;2.5 DTO模式（重要防御层）&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;场景&lt;/span&gt;：用户提交的数据就像未安检的行李&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;创建user.dto.ts
exportclassCreateUserDto{
@IsString()
@MinLength(5)
&amp;nbsp;&amp;nbsp;username:string;
@IsEmail()
&amp;nbsp;&amp;nbsp;email:string;
@IsStrongPassword()
&amp;nbsp;&amp;nbsp;password:string;
}
//&amp;nbsp;在控制器中使用
@Post()
createUser(@Body()&amp;nbsp;createUserDto:&amp;nbsp;CreateUserDto){
//&amp;nbsp;自动验证通过后才会执行到这里
returnthis.userService.create(createUserDto);
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;2.6 常见问题现场诊断&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：什么时候用@Param，什么时候用@Query？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;用@Param：/users/123 （标识具体资源）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;用@Query：/users?role=admin （过滤条件）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：DTO和普通的TypeScript接口有什么区别？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;接口：只是类型声明&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;DTO：携带验证规则，实际参与运行时校验&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;       border-bottom: 1px solid rgb(204, 204, 204);     font-size: 16px;  &quot;/&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第三部分：服务层——你的业务「后厨团队」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;3.1 服务层定位&lt;/h5&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;控制器 = 服务员（接收点单）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;服务层 = 厨师团队（实际烹饪）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;模块 = 餐厅部门划分（中厨/西厨）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;3.2 创建标准服务（用户注册流程）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;#&amp;nbsp;快速生成服务（附带测试文件）
nest&amp;nbsp;generate&amp;nbsp;service&amp;nbsp;user&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;基础服务结构：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;@Injectable()//&amp;nbsp;标记为可注入类
exportclassUserService{
//&amp;nbsp;模拟数据库
private&amp;nbsp;users:any[]=[];
//&amp;nbsp;实际业务操作
asyncregister(userDto:&amp;nbsp;CreateUserDto){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检查用户名是否重复
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;exist&amp;nbsp;=this.users.find(u&amp;nbsp;=&amp;gt;&amp;nbsp;u.username&amp;nbsp;===&amp;nbsp;userDto.username);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(exist){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;thrownewConflictException(&amp;#39;用户名已存在&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;模拟入库操作
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;newUser&amp;nbsp;={
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;id:&amp;nbsp;Date.now(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...userDto,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;createdAt:newDate()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.users.push(newUser);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;success:true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data:&amp;nbsp;_.omit(newUser,[&amp;#39;password&amp;#39;])//&amp;nbsp;使用lodash过滤敏感字段
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};
}
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;3.3 控制器与服务联动&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;@Controller(&amp;#39;users&amp;#39;)
exportclassUserController{
//&amp;nbsp;依赖注入服务实例
constructor(privatereadonly&amp;nbsp;userService:&amp;nbsp;UserService){}
@Post(&amp;#39;register&amp;#39;)
asyncregister(@Body()&amp;nbsp;dto:&amp;nbsp;CreateUserDto){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;控制器只做参数传递
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;returnawaitthis.userService.register(dto);
}
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;3.4 模块化拆分（数据库模块案例）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;database.module.ts
@Module({
&amp;nbsp;&amp;nbsp;providers:[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;provide:&amp;#39;DATABASE_CONNECTION&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;useFactory:async()=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;returnawaitcreateConnection({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type:&amp;#39;mysql&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;host:&amp;#39;localhost&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;port:3306,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;username:&amp;#39;root&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;password:&amp;#39;root&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;database:&amp;#39;test&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
],
&amp;nbsp;&amp;nbsp;exports:[&amp;#39;DATABASE_CONNECTION&amp;#39;]//&amp;nbsp;暴露给其他模块
})
exportclassDatabaseModule{}
//&amp;nbsp;在用户模块引入
@Module({
&amp;nbsp;&amp;nbsp;imports:[DatabaseModule],//&amp;nbsp;导入数据库工具
&amp;nbsp;&amp;nbsp;controllers:[UserController],
&amp;nbsp;&amp;nbsp;providers:[UserService]
})
exportclassUserModule{}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;3.5 异常处理艺术（错误分类）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;自定义业务异常
exportclassInsufficientBalanceExceptionextendsHttpException{
constructor(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;super(&amp;#39;账户余额不足&amp;#39;,402);//&amp;nbsp;特定状态码
}
}
//&amp;nbsp;在服务中使用
chargeUser(userId:number,&amp;nbsp;amount:number){
const&amp;nbsp;balance&amp;nbsp;=this.getBalance(userId);
if(balance&amp;nbsp;&amp;lt;&amp;nbsp;amount){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;thrownewInsufficientBalanceException();
}
//&amp;nbsp;扣款逻辑...
}
//&amp;nbsp;全局过滤器（进阶用法）
@Catch(InsufficientBalanceException)
exportclassBalanceFilterimplementsExceptionFilter{
catch(exception:&amp;nbsp;InsufficientBalanceException,&amp;nbsp;host:&amp;nbsp;ArgumentsHost){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;ctx&amp;nbsp;=&amp;nbsp;host.switchToHttp();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;response&amp;nbsp;=&amp;nbsp;ctx.getResponse();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;response.status(402).json({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;code:402,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message:&amp;#39;请先充值后再进行操作&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rechargeUrl:&amp;#39;/payment&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});
}
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;3.6 实战问答环节&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：服务层必须用@Injectable装饰器吗？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;必须，这是Nest识别可注入类的标记&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：什么时候应该创建新模块？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;当功能组件需要复用时（如数据库、第三方API）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;业务领域明确独立时（如用户模块、订单模块）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：为什么不用全局try-catch？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;Nest的异常过滤器机制更统一&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;可针对不同异常类型精细化处理&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;       border-bottom: 1px solid rgb(204, 204, 204);     font-size: 16px;  &quot;/&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第四部分：管道——你的数据「安检通道」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;4.1 管道核心作用&lt;/h5&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;验证&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：检查行李是否合规（数据格式）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;转换&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：把外币兑换成本地货币（数据格式化）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;过滤&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：没收违禁物品（清理不必要字段）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;4.2 内置管道实战&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;单个路由使用
@Get(&amp;#39;:id&amp;#39;)
findOne(
@Param(&amp;#39;id&amp;#39;,&amp;nbsp;ParseIntPipe)&amp;nbsp;id:number//&amp;nbsp;自动转换数字
){
return`查询ID为${id}的用户`;
}
//&amp;nbsp;测试案例：
//&amp;nbsp;访问&amp;nbsp;/users/abc&amp;nbsp;将自动返回400错误
//&amp;nbsp;正确访问&amp;nbsp;/users/123&amp;nbsp;得到数字类型的123&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;4.3 自定义管道开发（手机号格式验证）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;phone.pipe.ts
@Injectable()
exportclassPhoneValidationPipeimplementsPipeTransform{
transform(value:any){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;valid&amp;nbsp;=/^1[3-9]\d{9}$/.test(value);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!valid){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;thrownewBadRequestException(&amp;#39;手机号格式错误&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;value.replace(/(\d{3})\d{4}(\d{4})/,&amp;#39;$1****$2&amp;#39;);//&amp;nbsp;自动脱敏
}
}
//&amp;nbsp;在控制器中使用
@Post(&amp;#39;bind-phone&amp;#39;)
bindPhone(
@Body(&amp;#39;phone&amp;#39;,&amp;nbsp;PhoneValidationPipe)&amp;nbsp;phone:string
){
return`绑定成功：${phone}`;
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;4.4 全局管道配置（推荐方案）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;main.ts&amp;nbsp;启动文件
asyncfunctionbootstrap(){
const&amp;nbsp;app&amp;nbsp;=await&amp;nbsp;NestFactory.create(AppModule);
//&amp;nbsp;全局启用数据验证
&amp;nbsp;&amp;nbsp;app.useGlobalPipes(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newValidationPipe({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;whitelist:true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;自动过滤DTO外的字段
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;transform:true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;自动类型转换
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disableErrorMessages:&amp;nbsp;process.env.NODE_ENV===&amp;#39;production&amp;#39;//&amp;nbsp;生产环境隐藏错误详情
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})
);
await&amp;nbsp;app.listen(3000);
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;4.5 Class Validator深度集成（企业级方案）&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;安装必要包：&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;npm&amp;nbsp;install&amp;nbsp;class-validator&amp;nbsp;class-transformer&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;DTO增强：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;create-user.dto.ts
exportclassCreateUserDto{
@IsString()
@Length(2,20,{&amp;nbsp;message:&amp;#39;用户名长度需在2-20字符之间&amp;#39;})
&amp;nbsp;&amp;nbsp;username:string;
@IsEmail({},{&amp;nbsp;message:&amp;#39;必须是有效的邮箱格式&amp;#39;})
&amp;nbsp;&amp;nbsp;email:string;
@Matches(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/,{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message:&amp;#39;密码必须包含字母和数字，至少8位&amp;#39;
})
&amp;nbsp;&amp;nbsp;password:string;
@Type(()=&amp;gt;&amp;nbsp;Number)//&amp;nbsp;配合class-transformer转换类型
@IsInt({&amp;nbsp;message:&amp;#39;年龄必须是整数&amp;#39;})
@Min(18,{&amp;nbsp;message:&amp;#39;未满18岁不得注册&amp;#39;})
&amp;nbsp;&amp;nbsp;age:number;
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;错误响应示例：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;当验证失败时自动返回
{
&amp;quot;statusCode&amp;quot;:400,
&amp;quot;message&amp;quot;:[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;用户名长度需在2-20字符之间&amp;quot;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;必须是有效的邮箱格式&amp;quot;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;未满18岁不得注册&amp;quot;
],
&amp;quot;error&amp;quot;:&amp;quot;Bad&amp;nbsp;Request&amp;quot;
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;4.6 常见问题排雷&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：管道和中间件有什么区别？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;中间件：更底层，处理HTTP请求/响应（跨域、日志）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;管道：专注处理请求参数（路由参数、查询参数、请求体）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：为什么要用class-transformer？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;处理原始请求数据到类实例的转换&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;解决嵌套对象、数组等复杂结构的类型转换&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：生产环境为什么要禁用错误详情？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;防止敏感信息泄露（如数据库字段结构）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;避免给攻击者提供线索&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;       border-bottom: 1px solid rgb(204, 204, 204);     font-size: 16px;  &quot;/&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第五部分：守卫——你的系统「安检门禁」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;5.1 守卫核心职责&lt;/h5&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;身份核验&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：检查登机牌（是否登录）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;权限确认&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：检查舱位等级（用户角色）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;访问控制&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：拦截危险人员（黑名单IP）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;5.2 创建JWT守卫（实战认证方案）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;jwt.guard.ts
@Injectable()
exportclassJwtAuthGuardimplementsCanActivate{
constructor(private&amp;nbsp;jwtService:&amp;nbsp;JwtService){}
canActivate(context:&amp;nbsp;ExecutionContext):boolean{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;request&amp;nbsp;=&amp;nbsp;context.switchToHttp().getRequest();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;token&amp;nbsp;=this.extractToken(request);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!token){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;thrownewUnauthorizedException(&amp;#39;请先登录&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;payload&amp;nbsp;=this.jwtService.verify(token);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;request.user&amp;nbsp;=&amp;nbsp;payload;//&amp;nbsp;注入用户信息到请求对象
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;returntrue;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}catch{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;thrownewUnauthorizedException(&amp;#39;登录凭证已过期&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}
privateextractToken(request:&amp;nbsp;Request):string|null{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;request.headers.authorization?.split(&amp;#39;&amp;nbsp;&amp;#39;)[1]||null;
}
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;5.3 角色权限守卫（RBAC实现）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;roles.decorator.ts（自定义装饰器）
exportconstRoles=(...roles:string[])=&amp;gt;SetMetadata(&amp;#39;roles&amp;#39;,&amp;nbsp;roles);
//&amp;nbsp;roles.guard.ts
@Injectable()
exportclassRolesGuardimplementsCanActivate{
constructor(private&amp;nbsp;reflector:&amp;nbsp;Reflector){}
canActivate(context:&amp;nbsp;ExecutionContext):boolean{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;requiredRoles&amp;nbsp;=this.reflector.get&amp;lt;string[]&amp;gt;(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;roles&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;context.getHandler()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!requiredRoles)returntrue;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const{&amp;nbsp;user&amp;nbsp;}=&amp;nbsp;context.switchToHttp().getRequest();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;requiredRoles.some(role&amp;nbsp;=&amp;gt;&amp;nbsp;user.roles?.includes(role));
}
}
//&amp;nbsp;控制器使用示例
@Post(&amp;#39;admin/reports&amp;#39;)
@UseGuards(JwtAuthGuard,&amp;nbsp;RolesGuard)
@Roles(&amp;#39;admin&amp;#39;,&amp;#39;superadmin&amp;#39;)
generateReport(){
return&amp;#39;生成管理员专属报表&amp;#39;;
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;5.4 守卫注册方式（灵活配置）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;全局注册（main.ts）
app.useGlobalGuards(newJwtAuthGuard());
//&amp;nbsp;控制器级别
@Controller(&amp;#39;orders&amp;#39;)
@UseGuards(JwtAuthGuard)
exportclassOrderController{}
//&amp;nbsp;路由方法级别
@Get(&amp;#39;secret&amp;#39;)
@UseGuards(RolesGuard)
getSecretData(){}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;5.5 第三方登录集成（Github OAuth示例）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;github.strategy.ts（Passport集成）
@Injectable()
exportclassGithubStrategyextendsPassportStrategy(Strategy,&amp;#39;github&amp;#39;){
constructor(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;super({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;clientID:&amp;nbsp;process.env.GITHUB_CLIENT_ID,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;clientSecret:&amp;nbsp;process.env.GITHUB_SECRET,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;callbackURL:&amp;#39;/auth/github/callback&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;scope:[&amp;#39;user:email&amp;#39;]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});
}
asyncvalidate(accessToken:string,&amp;nbsp;_refreshToken:string,&amp;nbsp;profile:any){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;provider:&amp;#39;github&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uid:&amp;nbsp;profile.id,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;email:&amp;nbsp;profile.emails[0].value,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;username:&amp;nbsp;profile.username
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};
}
}
//&amp;nbsp;在控制器中使用
@Get(&amp;#39;auth/github&amp;#39;)
@UseGuards(AuthGuard(&amp;#39;github&amp;#39;))
githubLogin(){}
@Get(&amp;#39;auth/github/callback&amp;#39;)
@UseGuards(AuthGuard(&amp;#39;github&amp;#39;))
githubCallback(@Req()&amp;nbsp;req){
returnthis.authService.handleOAuthLogin(req.user);
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;5.6 安全防护常见问题&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：守卫和中间件的执行顺序？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;中间件 -&amp;gt; 守卫 -&amp;gt; 拦截器 -&amp;gt; 管道 -&amp;gt; 控制器方法&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：如何实现权限分级管理？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;角色定义建议
enum&amp;nbsp;UserRole&amp;nbsp;{
TOURIST=1,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;游客
USER=10,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;普通用户
EDITOR=20,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;内容编辑
ADMIN=99&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;系统管理员
}
//&amp;nbsp;权限检查时使用数字比对
hasPermission(userRole:number,&amp;nbsp;requiredRole:number){
return&amp;nbsp;userRole&amp;nbsp;&amp;gt;=&amp;nbsp;requiredRole;
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;span style=&quot; font-weight: 700;     font-size: 16px;  &quot;&gt;Q：如何处理多设备登录问题？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;生成带设备类型的JWT
createToken(userId:string,&amp;nbsp;deviceType:string){
returnthis.jwtService.sign({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sub:&amp;nbsp;userId,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;device:&amp;nbsp;deviceType&amp;nbsp;//&amp;nbsp;web/mobile/iot
});
}
//&amp;nbsp;在守卫中检查设备合法性
if(payload.device&amp;nbsp;!==&amp;#39;web&amp;#39;){
thrownewForbiddenException(&amp;#39;该设备无访问权限&amp;#39;);
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第六部分：拦截器——你的数据「物流中心」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;6.1 拦截器核心能力（快递分拣系统比喻）&lt;/h5&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;请求预处理&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：包裹分类贴标签（添加全局请求头）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;响应格式化&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：统一包装盒规格（标准化响应结构）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;异常捕获&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：破损包裹拦截（错误日志记录）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;性能监控&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：运输时效统计（接口耗时计算）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;6.2 创建基础拦截器（响应标准化）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;response.interceptor.ts
@Injectable()
exportclassResponseInterceptorimplementsNestInterceptor{
intercept(context:&amp;nbsp;ExecutionContext,&amp;nbsp;next:&amp;nbsp;CallHandler):&amp;nbsp;Observable&amp;lt;any&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;ctx&amp;nbsp;=&amp;nbsp;context.switchToHttp();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;response&amp;nbsp;=&amp;nbsp;ctx.getResponse();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;统一设置响应头
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;response.setHeader(&amp;#39;X-Powered-By&amp;#39;,&amp;#39;NestJS&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;next.handle().pipe(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;map(data&amp;nbsp;=&amp;gt;({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;code:200,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;success:true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timestamp:newDate().toISOString(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data:&amp;nbsp;_.isObject(data)?&amp;nbsp;data&amp;nbsp;:{&amp;nbsp;result:&amp;nbsp;data&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);
}
}
//&amp;nbsp;使用效果：
//&amp;nbsp;原始返回:&amp;nbsp;&amp;#39;Hello&amp;nbsp;World&amp;#39;
//&amp;nbsp;处理后返回:&amp;nbsp;
//&amp;nbsp;{
//&amp;nbsp;&amp;nbsp;&amp;nbsp;code:&amp;nbsp;200,
//&amp;nbsp;&amp;nbsp;&amp;nbsp;success:&amp;nbsp;true,
//&amp;nbsp;&amp;nbsp;&amp;nbsp;timestamp:&amp;nbsp;&amp;quot;2023-08-20T08:00:00Z&amp;quot;,
//&amp;nbsp;&amp;nbsp;&amp;nbsp;data:&amp;nbsp;{&amp;nbsp;result:&amp;nbsp;&amp;quot;Hello&amp;nbsp;World&amp;quot;&amp;nbsp;}
//&amp;nbsp;}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;6.3 多场景实战应用&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;案例一：API耗时监控&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;intercept(context:&amp;nbsp;ExecutionContext,&amp;nbsp;next:&amp;nbsp;CallHandler){
const&amp;nbsp;start&amp;nbsp;=&amp;nbsp;Date.now();
return&amp;nbsp;next.handle().pipe(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tap(()=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;duration&amp;nbsp;=&amp;nbsp;Date.now()-&amp;nbsp;start;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(`接口耗时：${duration}ms`);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})
);
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;span style=&quot; font-weight: 700;     font-size: 16px;  &quot;&gt;案例二：敏感数据脱敏&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;map(data&amp;nbsp;=&amp;gt;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;if&amp;nbsp;(data?.phone)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data.phone&amp;nbsp;=&amp;nbsp;data.phone.replace(/(\d{3})\d{4}(\d{4})/,&amp;nbsp;&amp;#39;$1****$2&amp;#39;);
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;return&amp;nbsp;data;
})&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;span style=&quot; font-weight: 700;     font-size: 16px;  &quot;&gt;案例三：请求日志记录&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;request&amp;nbsp;=&amp;nbsp;context.switchToHttp().getRequest();
logger.info(`[${request.method}]&amp;nbsp;${request.url}&amp;nbsp;-&amp;nbsp;Body:&amp;nbsp;${JSON.stringify(request.body)}`);
return&amp;nbsp;next.handle().pipe(
&amp;nbsp;&amp;nbsp;catchError(err&amp;nbsp;=&amp;gt;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;logger.error(`请求失败：${err.stack}`);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;throwError(()&amp;nbsp;=&amp;gt;&amp;nbsp;err);
&amp;nbsp;&amp;nbsp;})
);&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;6.4 全局拦截器配置&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;main.ts
app.useGlobalInterceptors(
&amp;nbsp;&amp;nbsp;new&amp;nbsp;ResponseInterceptor(),
&amp;nbsp;&amp;nbsp;new&amp;nbsp;TimeoutInterceptor(5000)&amp;nbsp;//&amp;nbsp;请求超时设置
);&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;6.5 高阶应用：缓存拦截器&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;cache.interceptor.ts
@Injectable()
exportclassCacheInterceptorimplementsNestInterceptor{
private&amp;nbsp;cache&amp;nbsp;=newMap&amp;lt;string,&amp;nbsp;any&amp;gt;();
intercept(context:&amp;nbsp;ExecutionContext,&amp;nbsp;next:&amp;nbsp;CallHandler){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;request&amp;nbsp;=&amp;nbsp;context.switchToHttp().getRequest();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;cacheKey&amp;nbsp;=&amp;nbsp;request.originalUrl;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(request.method&amp;nbsp;!==&amp;#39;GET&amp;#39;)return&amp;nbsp;next.handle();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;cached&amp;nbsp;=this.cache.get(cacheKey);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(cached){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;returnof(cached);//&amp;nbsp;直接返回缓存
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;next.handle().pipe(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tap(response&amp;nbsp;=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.cache.set(cacheKey,&amp;nbsp;response);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setTimeout(()=&amp;gt;this.cache.delete(cacheKey),60000);//&amp;nbsp;60秒后清除
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);
}
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;6.6 拦截器使用原则&lt;/h5&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;职责单一：每个拦截器专注一个任务&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;执行顺序：&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;请求 -&amp;gt; 全局拦截器 -&amp;gt; 控制器拦截器 -&amp;gt; 路由方法拦截器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;性能注意：避免在拦截器中做重型操作&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;6.7 常见问题解答&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：拦截器 vs 中间件 vs 过滤器？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;中间件：处理原始HTTP请求（跨域、压缩）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;拦截器：处理控制器输入输出（业务相关）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;过滤器：捕获未处理的异常（兜底处理）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：如何跳过某些路由的拦截器？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;使用自定义元数据装饰器
exportconstSkipInterceptor=()=&amp;gt;SetMetadata(&amp;#39;skipInterceptor&amp;#39;,true);
//&amp;nbsp;在拦截器中判断
const&amp;nbsp;shouldSkip&amp;nbsp;=this.reflector.get&amp;lt;boolean&amp;gt;(&amp;#39;skipInterceptor&amp;#39;,&amp;nbsp;context.getHandler());
if(shouldSkip)return&amp;nbsp;next.handle()&lt;/pre&gt;&lt;p&gt;Q：如何处理异步操作？&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;超时控制示例
intercept(context:&amp;nbsp;ExecutionContext,&amp;nbsp;next:&amp;nbsp;CallHandler){
return&amp;nbsp;next.handle().pipe(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timeout(5000),//&amp;nbsp;5秒超时
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catchError(err&amp;nbsp;=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(err&amp;nbsp;instanceofTimeoutError){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;thrownewRequestTimeoutException();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;returnthrowError(()=&amp;gt;&amp;nbsp;err);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})
);
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr style=&quot;       border-bottom: 1px solid rgb(204, 204, 204);     font-size: 16px;  &quot;/&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第七部分：中间件——你的请求「预处理车间」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;7.1 中间件定位&lt;/h5&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;执行阶段&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：控制器之前处理原始请求&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;典型场景&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：&lt;/p&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: circle;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;请求日志记录&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;跨域头设置&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;用户身份预校验&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;请求体压缩处理&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;7.2 创建日志中间件（实战演示）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;logger.middleware.ts
import{&amp;nbsp;Request,&amp;nbsp;Response,&amp;nbsp;NextFunction&amp;nbsp;}from&amp;#39;express&amp;#39;;
exportfunctionLoggerMiddleware(req:&amp;nbsp;Request,&amp;nbsp;res:&amp;nbsp;Response,&amp;nbsp;next:&amp;nbsp;NextFunction){
const&amp;nbsp;start&amp;nbsp;=&amp;nbsp;Date.now();
&amp;nbsp;&amp;nbsp;res.on(&amp;#39;finish&amp;#39;,()=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;duration&amp;nbsp;=&amp;nbsp;Date.now()-&amp;nbsp;start;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;`[${new&amp;nbsp;Date().toISOString()}]&amp;nbsp;${req.method}&amp;nbsp;${req.originalUrl}&amp;nbsp;-&amp;nbsp;${res.statusCode}&amp;nbsp;(${duration}ms)`
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);
});
next();//&amp;nbsp;必须调用next继续传递
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;7.3 中间件注册方式（三种绑定策略）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;全局中间件（main.ts）
app.use(LoggerMiddleware);
//&amp;nbsp;模块中间件（app.module.ts）
exportclassAppModuleimplementsNestModule{
configure(consumer:&amp;nbsp;MiddlewareConsumer){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;consumer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.apply(LoggerMiddleware)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.forRoutes({&amp;nbsp;path:&amp;#39;user*&amp;#39;,&amp;nbsp;method:&amp;nbsp;RequestMethod.ALL});//&amp;nbsp;匹配/user开头的所有路由
}
}
//&amp;nbsp;路由排除法
consumer
.apply(AuthMiddleware)
.exclude(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;path:&amp;#39;auth/login&amp;#39;,&amp;nbsp;method:&amp;nbsp;RequestMethod.POST},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;path:&amp;#39;docs&amp;#39;,&amp;nbsp;method:&amp;nbsp;RequestMethod.GET}
)
.forRoutes(&amp;#39;*&amp;#39;);&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;7.4 文件上传处理（Multer集成方案）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;安装依赖
npm&amp;nbsp;install&amp;nbsp;@nestjs/platform-express&amp;nbsp;multer&amp;nbsp;@types/multer
//&amp;nbsp;文件上传控制器
@Post(&amp;#39;avatar&amp;#39;)
@UseInterceptors(FileInterceptor(&amp;#39;file&amp;#39;))
uploadAvatar(
@UploadedFile()&amp;nbsp;file:&amp;nbsp;Express.Multer.File,
@Body()&amp;nbsp;userId:string
){
returnthis.userService.updateAvatar(userId,&amp;nbsp;file);
}
//&amp;nbsp;配置文件存储（自定义配置）
const&amp;nbsp;storage&amp;nbsp;=&amp;nbsp;multer.diskStorage({
destination:(req,&amp;nbsp;file,&amp;nbsp;cb)=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cb(null,&amp;#39;./uploads&amp;#39;);
},
filename:(req,&amp;nbsp;file,&amp;nbsp;cb)=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;ext&amp;nbsp;=&amp;nbsp;path.extname(file.originalname);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cb(null,`${Date.now()}${ext}`);
}
});
//&amp;nbsp;在模块中注册
@Module({
&amp;nbsp;&amp;nbsp;imports:[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MulterModule.register({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;storage:&amp;nbsp;storage,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;limits:{&amp;nbsp;fileSize:1024*1024*5}//&amp;nbsp;5MB限制
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})
]
})
exportclassFileModule{}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;7.5 第三方中间件集成（安全防护）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;安装安全中间件
npm&amp;nbsp;install&amp;nbsp;helmet&amp;nbsp;compression
//&amp;nbsp;main.ts配置
import*as&amp;nbsp;helmet&amp;nbsp;from&amp;#39;helmet&amp;#39;;
import*as&amp;nbsp;compression&amp;nbsp;from&amp;#39;compression&amp;#39;;
asyncfunctionbootstrap(){
const&amp;nbsp;app&amp;nbsp;=await&amp;nbsp;NestFactory.create(AppModule);
//&amp;nbsp;安全头设置
&amp;nbsp;&amp;nbsp;app.use(helmet({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;contentSecurityPolicy:false//&amp;nbsp;根据需求配置
}));
//&amp;nbsp;响应压缩
&amp;nbsp;&amp;nbsp;app.use(compression({&amp;nbsp;level:6}));
await&amp;nbsp;app.listen(3000);
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;7.6 中间件开发准则&lt;/h5&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;功能纯净&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：避免在一个中间件中做多件不相关的事&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;性能优先&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：不要阻塞事件循环（避免同步耗时操作）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;错误处理&lt;/span&gt;：必须捕获并传递错误&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;app.use((err,&amp;nbsp;req,&amp;nbsp;res,&amp;nbsp;next)&amp;nbsp;=&amp;gt;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;console.error(err.stack);
&amp;nbsp;&amp;nbsp;res.status(500).send(&amp;#39;服务器开小差了！&amp;#39;);
});&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;7.7 常见问题破解&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：中间件和过滤器的区别？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;中间件：处理请求/响应周期中的原始数据&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;过滤器：处理控制器抛出的异常&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：如何实现CSRF防护？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;安装csrf防护
npm&amp;nbsp;install&amp;nbsp;csurf&amp;nbsp;@types/csurf
//&amp;nbsp;使用中间件
import*as&amp;nbsp;csurf&amp;nbsp;from&amp;#39;csurf&amp;#39;;
app.use(csurf());
app.use((req,&amp;nbsp;res,&amp;nbsp;next)=&amp;gt;{
&amp;nbsp;&amp;nbsp;res.cookie(&amp;#39;XSRF-TOKEN&amp;#39;,&amp;nbsp;req.csrfToken());
next();
});
//&amp;nbsp;前端需要在请求头携带
headers:{
&amp;#39;X-XSRF-TOKEN&amp;#39;:getCookie(&amp;#39;XSRF-TOKEN&amp;#39;)
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;     font-size: 16px;  &quot;&gt;Q：处理大文件上传优化策略？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;分片上传中间件
app.post(&amp;#39;/upload&amp;#39;,(req,&amp;nbsp;res)=&amp;gt;{
const&amp;nbsp;chunk&amp;nbsp;=&amp;nbsp;req.body.chunk;
const&amp;nbsp;index&amp;nbsp;=&amp;nbsp;req.body.index;
const&amp;nbsp;total&amp;nbsp;=&amp;nbsp;req.body.total;
//&amp;nbsp;将分片暂存到临时目录
&amp;nbsp;&amp;nbsp;fs.writeFileSync(`./temp/${index}`,&amp;nbsp;chunk);
if(index&amp;nbsp;===&amp;nbsp;total){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;合并所有分片
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mergeFiles(total);
}
&amp;nbsp;&amp;nbsp;res.sendStatus(200);
});&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr style=&quot;       border-bottom: 1px solid rgb(204, 204, 204);     font-size: 16px;  &quot;/&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第八部分：微服务——你的业务「集团分部」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;8.1 微服务核心特征（连锁餐厅）&lt;/h5&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;独立运营&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：每家分店自主管理（服务自治）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;专业分工&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：中央厨房负责食材供应（服务拆分）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;统一协调&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：总部调度各分店资源（服务发现）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;容错机制&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;：某分店停业不影响整体（熔断降级）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;8.2 创建基础微服务（TCP通信示例）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;#&amp;nbsp;创建用户服务（独立项目）
nest&amp;nbsp;new&amp;nbsp;user-service&amp;nbsp;--strict
#&amp;nbsp;创建订单服务（独立项目）
nest&amp;nbsp;new&amp;nbsp;order-service&amp;nbsp;--strict&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;用户服务配置：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;main.ts
asyncfunctionbootstrap(){
const&amp;nbsp;app&amp;nbsp;=await&amp;nbsp;NestFactory.createMicroservice&amp;lt;MicroserviceOptions&amp;gt;(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AppModule,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;transport:&amp;nbsp;Transport.TCP,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;options:{&amp;nbsp;host:&amp;#39;localhost&amp;#39;,&amp;nbsp;port:3001}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
);
await&amp;nbsp;app.listen();
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;订单服务调用配置：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;order.module.ts
@Module({
&amp;nbsp;&amp;nbsp;imports:[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ClientsModule.register([
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name:&amp;#39;USER_SERVICE&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;transport:&amp;nbsp;Transport.TCP,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;options:{&amp;nbsp;host:&amp;#39;localhost&amp;#39;,&amp;nbsp;port:3001}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;])
]
})&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;8.3 跨服务通信模式（实战演示）&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;场景：创建订单时验证用户&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;order.service.ts
@Injectable()
exportclassOrderService{
constructor(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Inject(&amp;#39;USER_SERVICE&amp;#39;)private&amp;nbsp;userClient:&amp;nbsp;ClientProxy
){}
asynccreateOrder(userId:string,&amp;nbsp;items:string[]){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;调用用户服务验证
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;userValid&amp;nbsp;=awaitthis.userClient
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.send&amp;lt;boolean&amp;gt;(&amp;#39;validateUser&amp;#39;,&amp;nbsp;userId)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.toPromise();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!userValid){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;thrownewBadRequestException(&amp;#39;用户不存在&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;创建订单逻辑...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return{&amp;nbsp;orderId:&amp;nbsp;Date.now().toString()};
}
}
//&amp;nbsp;user.controller.ts（用户服务）
@MessagePattern(&amp;#39;validateUser&amp;#39;)
validateUser(@Payload()&amp;nbsp;userId:string){
returnthis.userService.exists(userId);//&amp;nbsp;返回布尔值
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;8.4 消息队列集成（RabbitMQ案例）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;安装依赖
npm&amp;nbsp;install&amp;nbsp;@nestjs/microservices&amp;nbsp;amqplib&amp;nbsp;amqp-connection-manager
//&amp;nbsp;邮件服务配置
const&amp;nbsp;app&amp;nbsp;=await&amp;nbsp;NestFactory.createMicroservice&amp;lt;MicroserviceOptions&amp;gt;(
&amp;nbsp;&amp;nbsp;AppModule,
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;transport:&amp;nbsp;Transport.RMQ,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;options:{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;urls:[&amp;#39;amqp://localhost:5672&amp;#39;],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;queue:&amp;#39;email_queue&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;queueOptions:{&amp;nbsp;durable:true}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}
);
//&amp;nbsp;订单服务发送邮件通知
this.emailClient.emit(&amp;#39;send_order_email&amp;#39;,{
&amp;nbsp;&amp;nbsp;email:&amp;#39;user@example.com&amp;#39;,
&amp;nbsp;&amp;nbsp;orderId:&amp;#39;12345&amp;#39;
});&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;8.5 网关统一入口（API网关模式）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;api-gateway项目配置
@Controller()
exportclassApiController{
constructor(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Inject(&amp;#39;USER_SERVICE&amp;#39;)private&amp;nbsp;userClient:&amp;nbsp;ClientProxy,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Inject(&amp;#39;ORDER_SERVICE&amp;#39;)private&amp;nbsp;orderClient:&amp;nbsp;ClientProxy
){}
@Get(&amp;#39;user/:id/orders&amp;#39;)
asyncgetUserOrders(@Param(&amp;#39;id&amp;#39;)&amp;nbsp;userId:string){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;并行调用两个服务
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const[user,&amp;nbsp;orders]=awaitPromise.all([
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.userClient.send(&amp;#39;getUser&amp;#39;,&amp;nbsp;userId).toPromise(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.orderClient.send(&amp;#39;getUserOrders&amp;#39;,&amp;nbsp;userId).toPromise()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return{...user,&amp;nbsp;orders&amp;nbsp;};
}
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;8.6 分布式系统常见问题&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：如何保证数据一致性？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;使用Saga模式示例
asynccreateOrder(){
try{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;阶段1：扣减库存
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;inventoryClient.emit(&amp;#39;reduce_stock&amp;#39;,&amp;nbsp;items);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;阶段2：创建订单
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;order&amp;nbsp;=awaitthis.create(orderData);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;阶段3：扣款
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;paymentClient.emit(&amp;#39;deduct_balance&amp;#39;,&amp;nbsp;userId);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;order;
}catch(error){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;补偿操作
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;inventoryClient.emit(&amp;#39;rollback_stock&amp;#39;,&amp;nbsp;items);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;paymentClient.emit(&amp;#39;rollback_balance&amp;#39;,&amp;nbsp;userId);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&amp;nbsp;error;
}
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;span style=&quot; font-weight: 700;     font-size: 16px;  &quot;&gt;Q：如何实现服务发现？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;使用Consul配置示例
transport:&amp;nbsp;Transport.CONSUL,
options:{
&amp;nbsp;&amp;nbsp;host:&amp;#39;consul-server&amp;#39;,
&amp;nbsp;&amp;nbsp;port:8500,
&amp;nbsp;&amp;nbsp;service:{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name:&amp;#39;user-service&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;check:{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;interval:&amp;#39;10s&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;http:&amp;#39;http://localhost:3001/health&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;     font-size: 16px;  &quot;&gt;Q：如何监控微服务健康？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;健康检查端点
@Get(&amp;#39;health&amp;#39;)
@HealthCheck()
checkHealth(){
returnthis.health.check([
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;()=&amp;gt;this.db.ping().then(()=&amp;gt;&amp;nbsp;HealthCheckResult.healthy()),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;()=&amp;gt;this.cache.ping().then(()=&amp;gt;&amp;nbsp;HealthCheckResult.healthy())
]);
}&lt;/pre&gt;&lt;hr style=&quot;       border-bottom: 1px solid rgb(204, 204, 204);     font-size: 16px;  &quot;/&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第九部分：MySQL集成——你的数据「智能仓库」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.1 ORM核心概念（仓库管理员比喻）&lt;/h5&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;实体（Entity）&amp;nbsp;= 货物清单（数据结构定义）&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;仓库（Repository）&amp;nbsp;= 货架管理员（数据存取操作）&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;迁移（Migration）&amp;nbsp;= 仓库改造记录（数据结构变更）&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.2 环境配置（.env标准方案）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;#&amp;nbsp;.env
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=nest_demo
DB_SYNC=false&amp;nbsp;#&amp;nbsp;生产环境必须关闭！&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.3 实体定义规范（用户模型案例）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;user.entity.ts
@Entity()
exportclassUser{
@PrimaryGeneratedColumn()
&amp;nbsp;&amp;nbsp;id:number;
@Column({&amp;nbsp;length:30,&amp;nbsp;comment:&amp;#39;登录账号&amp;#39;})
&amp;nbsp;&amp;nbsp;username:string;
@Column({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;select:false,//&amp;nbsp;查询时默认排除
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;comment:&amp;#39;加密后的密码&amp;#39;
})
&amp;nbsp;&amp;nbsp;password:string;
@Column({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type:&amp;#39;enum&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;enum:&amp;nbsp;UserRole,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default:&amp;nbsp;UserRole.USER
})
&amp;nbsp;&amp;nbsp;role:&amp;nbsp;UserRole;
@CreateDateColumn()
&amp;nbsp;&amp;nbsp;createdAt:&amp;nbsp;Date;
@UpdateDateColumn()
&amp;nbsp;&amp;nbsp;updatedAt:&amp;nbsp;Date;
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.4 数据库模块注册（动态配置）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;database.module.ts
@Module({
&amp;nbsp;&amp;nbsp;imports:[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TypeOrmModule.forRootAsync({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imports:[ConfigModule],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;useFactory:(config:&amp;nbsp;ConfigService)=&amp;gt;({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type:&amp;#39;mysql&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;host:&amp;nbsp;config.get(&amp;#39;DB_HOST&amp;#39;),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;port:&amp;nbsp;config.get(&amp;#39;DB_PORT&amp;#39;),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;username:&amp;nbsp;config.get(&amp;#39;DB_USER&amp;#39;),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;password:&amp;nbsp;config.get(&amp;#39;DB_PASSWORD&amp;#39;),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;database:&amp;nbsp;config.get(&amp;#39;DB_NAME&amp;#39;),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;entities:[__dirname&amp;nbsp;+&amp;#39;/../**/*.entity{.ts,.js}&amp;#39;],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;synchronize:&amp;nbsp;config.get(&amp;#39;DB_SYNC&amp;#39;),//&amp;nbsp;仅开发环境开启
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;logging:[&amp;#39;error&amp;#39;,&amp;#39;warn&amp;#39;]//&amp;nbsp;生产环境建议关闭
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;inject:[ConfigService]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})
]
})
exportclassDatabaseModule{}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.5 数据操作实战（CRUD演示）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;user.service.ts
@Injectable()
exportclassUserService{
constructor(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@InjectRepository(User)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;userRepository:&amp;nbsp;Repository&amp;lt;User&amp;gt;
){}
//&amp;nbsp;创建用户
asynccreate(userDto:&amp;nbsp;CreateUserDto){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;user&amp;nbsp;=this.userRepository.create({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...userDto,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;password:&amp;nbsp;bcrypt.hashSync(userDto.password,10)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;returnawaitthis.userRepository.save(user);
}
//&amp;nbsp;分页查询
asyncpaginate(page&amp;nbsp;=1,&amp;nbsp;limit&amp;nbsp;=10){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const[data,&amp;nbsp;total]=awaitthis.userRepository.findAndCount({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;skip:(page&amp;nbsp;-1)*&amp;nbsp;limit,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;take:&amp;nbsp;limit,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;order:{&amp;nbsp;id:&amp;#39;DESC&amp;#39;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;meta:{&amp;nbsp;total,&amp;nbsp;page,&amp;nbsp;last_page:&amp;nbsp;Math.ceil(total&amp;nbsp;/&amp;nbsp;limit)}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};
}
//&amp;nbsp;事务操作
asynctransferMoney(fromId:number,&amp;nbsp;toId:number,&amp;nbsp;amount:number){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;awaitthis.userRepository.manager.transaction(async&amp;nbsp;manager&amp;nbsp;=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;from&amp;nbsp;=await&amp;nbsp;manager.findOne(User,{&amp;nbsp;where:{&amp;nbsp;id:&amp;nbsp;fromId&amp;nbsp;}});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;to&amp;nbsp;=await&amp;nbsp;manager.findOne(User,{&amp;nbsp;where:{&amp;nbsp;id:&amp;nbsp;toId&amp;nbsp;}});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(from.balance&amp;nbsp;&amp;lt;&amp;nbsp;amount)thrownewError(&amp;#39;余额不足&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;manager.update(User,&amp;nbsp;fromId,{&amp;nbsp;balance:&amp;nbsp;from.balance&amp;nbsp;-&amp;nbsp;amount&amp;nbsp;});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;manager.update(User,&amp;nbsp;toId,{&amp;nbsp;balance:&amp;nbsp;to.balance&amp;nbsp;+&amp;nbsp;amount&amp;nbsp;});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});
}
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.6 复杂查询构建（QueryBuilder实战）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;多表联查示例
asyncgetUserWithOrders(userId:number){
returnthis.userRepository
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.createQueryBuilder(&amp;#39;user&amp;#39;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.leftJoinAndSelect(&amp;#39;user.orders&amp;#39;,&amp;#39;orders&amp;#39;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.where(&amp;#39;user.id&amp;nbsp;=&amp;nbsp;:id&amp;#39;,{&amp;nbsp;id:&amp;nbsp;userId&amp;nbsp;})
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.andWhere(&amp;#39;orders.status&amp;nbsp;=&amp;nbsp;:status&amp;#39;,{&amp;nbsp;status:&amp;#39;paid&amp;#39;})
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.orderBy(&amp;#39;orders.createdAt&amp;#39;,&amp;#39;DESC&amp;#39;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.getOne();
}
//&amp;nbsp;原生SQL执行
asynccountActiveUsers(){
returnthis.userRepository.query(`
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT&amp;nbsp;COUNT(*)&amp;nbsp;as&amp;nbsp;count&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM&amp;nbsp;users&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE&amp;nbsp;last_login_at&amp;nbsp;&amp;gt;&amp;nbsp;DATE_SUB(NOW(),&amp;nbsp;INTERVAL&amp;nbsp;30&amp;nbsp;DAY)
&amp;nbsp;&amp;nbsp;`);
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.7 性能优化方案&lt;/h5&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;索引优化：&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;@Index(&amp;#39;IDX_USERNAME&amp;#39;,&amp;nbsp;[&amp;#39;username&amp;#39;],&amp;nbsp;{&amp;nbsp;unique:&amp;nbsp;true&amp;nbsp;})
@Entity()
export&amp;nbsp;class&amp;nbsp;User&amp;nbsp;{&amp;nbsp;...&amp;nbsp;}&lt;/pre&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;查询缓存：&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;users&amp;nbsp;=awaitthis.userRepository.find({
&amp;nbsp;&amp;nbsp;where:{&amp;nbsp;role:&amp;#39;admin&amp;#39;},
&amp;nbsp;&amp;nbsp;cache:{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;id:&amp;#39;admin_users&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;milliseconds:60000//&amp;nbsp;1分钟缓存
}
});&lt;/pre&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;连接池配置：&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;database.module.ts
options:{
...,
&amp;nbsp;&amp;nbsp;extra:{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;connectionLimit:20,//&amp;nbsp;最大连接数
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;waitForConnections:true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;queueLimit:0
}
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.8 数据迁移管理（生产环境必须）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;#&amp;nbsp;生成迁移文件
npx&amp;nbsp;typeorm&amp;nbsp;migration:create&amp;nbsp;./migrations/InitSchema
#&amp;nbsp;执行迁移
npx&amp;nbsp;typeorm&amp;nbsp;migration:run
#&amp;nbsp;回滚迁移
npx&amp;nbsp;typeorm&amp;nbsp;migration:revert&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;迁移文件示例：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;export&amp;nbsp;classInitSchemaimplementsMigrationInterface{
publicasyncup(queryRunner:&amp;nbsp;QueryRunner):Promise&amp;lt;void&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;queryRunner.query(`
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CREATE&amp;nbsp;TABLE&amp;nbsp;users&amp;nbsp;(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;id&amp;nbsp;INT&amp;nbsp;UNSIGNED&amp;nbsp;AUTO_INCREMENT&amp;nbsp;PRIMARY&amp;nbsp;KEY,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;username&amp;nbsp;VARCHAR(30)&amp;nbsp;NOT&amp;nbsp;NULL&amp;nbsp;UNIQUE,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;password&amp;nbsp;VARCHAR(100)&amp;nbsp;NOT&amp;nbsp;NULL,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;created_at&amp;nbsp;TIMESTAMP&amp;nbsp;DEFAULT&amp;nbsp;CURRENT_TIMESTAMP
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&amp;nbsp;ENGINE=InnoDB;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;`);
}
publicasyncdown():Promise&amp;lt;void&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;queryRunner.dropTable(&amp;#39;users&amp;#39;);
}
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.9 安全注意事项&lt;/h5&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;SQL注入防护&lt;/span&gt;：&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;危险！
query(`SELECT&amp;nbsp;*&amp;nbsp;FROM&amp;nbsp;users&amp;nbsp;WHERE&amp;nbsp;name&amp;nbsp;=&amp;nbsp;&amp;#39;${name}&amp;#39;`);
//&amp;nbsp;安全✅
query(&amp;#39;SELECT&amp;nbsp;*&amp;nbsp;FROM&amp;nbsp;users&amp;nbsp;WHERE&amp;nbsp;name&amp;nbsp;=&amp;nbsp;?&amp;#39;,&amp;nbsp;[name]);&lt;/pre&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;始终使用参数化查询&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;避免直接拼接SQL语句&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;敏感数据处理&lt;/span&gt;：&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;密码加密处理
asyncfunctionhashPassword(password:string){
return&amp;nbsp;bcrypt.hash(password,10);
}
//&amp;nbsp;敏感字段排除
@Entity()
exportclassUser{
@Column({&amp;nbsp;select:false})
&amp;nbsp;&amp;nbsp;password:string;
}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;9.10 常见问题解答&lt;/h5&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：实体和DTO有什么区别？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;实体：描述数据库表结构（与数据库直接交互）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;DTO：定义接口传输格式（请求/响应结构）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：如何高效处理批量插入？&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;users&amp;nbsp;=[...];//&amp;nbsp;大量用户数据
awaitthis.userRepository
.createQueryBuilder()
.insert()
.into(User)
.values(users)
.orIgnore()//&amp;nbsp;忽略重复
.execute();&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px;        &quot;&gt;&lt;span style=&quot; font-weight: 700;  &quot;&gt;Q：事务处理的正确方式？&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;使用&lt;code style=&quot;  &quot;&gt;transaction&lt;/code&gt;方法包裹原子操作&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;避免在事务中执行长时间操作&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 18px;     &quot;&gt;注意事务隔离级别设置&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;       border-bottom: 1px solid rgb(204, 204, 204);     font-size: 16px;  &quot;/&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;第十部分：测试与部署——你的系统「质检&amp;amp;物流」&lt;/h4&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.1 测试金字塔模型（质量检测体系）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;-&amp;nbsp;单元测试（70%）：单个函数/类测试
-&amp;nbsp;集成测试（20%）：模块间协作测试
-&amp;nbsp;E2E测试（10%）：完整业务流程测试&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.2 单元测试实战（用户服务案例）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;user.service.spec.ts
describe(&amp;#39;UserService&amp;#39;,()=&amp;gt;{
let&amp;nbsp;service:&amp;nbsp;UserService;
let&amp;nbsp;mockRepository:&amp;nbsp;jest.Mocked&amp;lt;Repository&amp;lt;User&amp;gt;&amp;gt;;
beforeEach(async()=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;模拟数据库操作
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mockRepository&amp;nbsp;={
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;findOne:&amp;nbsp;jest.fn(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;save:&amp;nbsp;jest.fn().mockImplementation((user)=&amp;gt;&amp;nbsp;user)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}asany;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;module:&amp;nbsp;TestingModule&amp;nbsp;=await&amp;nbsp;Test.createTestingModule({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;providers:[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UserService,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;provide:getRepositoryToken(User),&amp;nbsp;useValue:&amp;nbsp;mockRepository&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}).compile();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;service&amp;nbsp;=&amp;nbsp;module.get&amp;lt;UserService&amp;gt;(UserService);
});
it(&amp;#39;创建用户时应加密密码&amp;#39;,async()=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;dto&amp;nbsp;={&amp;nbsp;username:&amp;#39;test&amp;#39;,&amp;nbsp;password:&amp;#39;123456&amp;#39;};
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;service.create(dto);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expect(mockRepository.save).toBeCalledWith(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expect.objectContaining({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;password:&amp;nbsp;expect.not.stringMatching(dto.password)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);
});
});&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.3 E2E测试配置（完整流程验证）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;app.e2e-spec.ts
describe(&amp;#39;用户模块&amp;nbsp;(e2e)&amp;#39;,()=&amp;gt;{
let&amp;nbsp;app:&amp;nbsp;INestApplication;
beforeAll(async()=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;moduleFixture&amp;nbsp;=await&amp;nbsp;Test.createTestingModule({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imports:[AppModule],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}).compile();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;app&amp;nbsp;=&amp;nbsp;moduleFixture.createNestApplication();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;app.init();
});
it(&amp;#39;/user/register&amp;nbsp;(POST)&amp;#39;,()=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;returnrequest(app.getHttpServer())
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.post(&amp;#39;/user/register&amp;#39;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.send({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;username:&amp;#39;e2e_test&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;password:&amp;#39;Test@123&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;email:&amp;#39;e2e@test.com&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.expect(201)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.expect(res&amp;nbsp;=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expect(res.body.data.username).toBe(&amp;#39;e2e_test&amp;#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expect(res.body.data.password).toBeUndefined();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});
});
afterAll(async()=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;await&amp;nbsp;app.close();
});
});&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;  font-size: 16px;  &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.4&amp;nbsp;Docker容器化（生产部署标准）&lt;/h5&gt;&lt;pre class=&quot;brush:bash;toolbar:false&quot;&gt;#&amp;nbsp;Dockerfile&amp;nbsp;三阶段构建
#&amp;nbsp;阶段一：构建环境
FROM&amp;nbsp;node:18-alpine&amp;nbsp;AS&amp;nbsp;builder
WORKDIR&amp;nbsp;/app
COPY&amp;nbsp;package*.json&amp;nbsp;./
RUN&amp;nbsp;npm&amp;nbsp;ci
COPY&amp;nbsp;.&amp;nbsp;.
RUN&amp;nbsp;npm&amp;nbsp;run&amp;nbsp;build
#&amp;nbsp;阶段二：生产依赖
FROM&amp;nbsp;node:18-alpine&amp;nbsp;AS&amp;nbsp;deps
WORKDIR&amp;nbsp;/app
COPY&amp;nbsp;package*.json&amp;nbsp;./
RUN&amp;nbsp;npm&amp;nbsp;ci&amp;nbsp;--production
#&amp;nbsp;阶段三：最终镜像
FROM&amp;nbsp;node:18-alpine
WORKDIR&amp;nbsp;/app
COPY&amp;nbsp;--from=builder&amp;nbsp;/app/dist&amp;nbsp;./dist
COPY&amp;nbsp;--from=deps&amp;nbsp;/app/node_modules&amp;nbsp;./node_modules
COPY&amp;nbsp;.env.prod&amp;nbsp;.
EXPOSE&amp;nbsp;3000
CMD&amp;nbsp;[&amp;quot;node&amp;quot;,&amp;nbsp;&amp;quot;dist/main.js&amp;quot;]&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.5 部署优化策略（生产环境配置）&lt;/h5&gt;&lt;pre class=&quot;brush:bash;toolbar:false&quot;&gt;#&amp;nbsp;.env.prod&amp;nbsp;生产配置
NODE_ENV=production
DB_HOST=mysql-prod
DB_PORT=3306
DB_USER=prod_user
DB_PASSWORD=${DB_PASSWORD}#&amp;nbsp;从安全仓库注入
DB_NAME=prod_db
DB_SYNC=false
#&amp;nbsp;docker-compose.yml
version:&amp;nbsp;&amp;#39;3.8&amp;#39;
services:
&amp;nbsp;&amp;nbsp;app:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;build:&amp;nbsp;.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ports:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;3000:3000&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;environment:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;DB_PASSWORD=${DB_PASSWORD}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;depends_on:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;mysql
&amp;nbsp;&amp;nbsp;mysql:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image:&amp;nbsp;mysql:8.0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;environment:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MYSQL_ROOT_PASSWORD:&amp;nbsp;${DB_ROOT_PASSWORD}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MYSQL_DATABASE:&amp;nbsp;prod_db
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;volumes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;mysql_data:/var/lib/mysql
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;command:&amp;nbsp;--default-authentication-plugin=mysql_native_password
volumes:
&amp;nbsp;&amp;nbsp;mysql_data:&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.6 监控与维护（生产必备）&lt;/h5&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;健康检查端点
@Get(&amp;#39;health&amp;#39;)
@HealthCheck()
checkHealth(){
returnthis.health.check([
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;()=&amp;gt;this.db.ping().then(()=&amp;gt;&amp;nbsp;HealthCheckResult.healthy()),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;()=&amp;gt;this.redis.ping().then(()=&amp;gt;&amp;nbsp;HealthCheckResult.healthy())
]);
}
//&amp;nbsp;日志切割配置（PM2）
module.exports&amp;nbsp;={
&amp;nbsp;&amp;nbsp;apps:[{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name:&amp;#39;nest-app&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;script:&amp;#39;dist/main.js&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;instances:&amp;#39;max&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;autorestart:true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;watch:false,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;max_memory_restart:&amp;#39;1G&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;error_file:&amp;#39;/var/log/nest-app/error.log&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;out_file:&amp;#39;/var/log/nest-app/out.log&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;log_date_format:&amp;#39;YYYY-MM-DD&amp;nbsp;HH:mm:ss&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merge_logs:true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;env_production:{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NODE_ENV:&amp;#39;production&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}]
};&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.7 持续集成实战（GitHub Actions）&lt;/h5&gt;&lt;pre class=&quot;brush:cf;toolbar:false&quot;&gt;#&amp;nbsp;.github/workflows/deploy.yml
name:&amp;nbsp;Deploy&amp;nbsp;Production
on:
push:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tags:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;#39;v*&amp;#39;
jobs:
build-and-deploy:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;runs-on:&amp;nbsp;ubuntu-latest
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;steps:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-name:&amp;nbsp;Checkout&amp;nbsp;code
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uses:&amp;nbsp;actions/checkout@v3
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-name:&amp;nbsp;Setup&amp;nbsp;Node.js
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uses:&amp;nbsp;actions/setup-node@v3
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;node-version:18
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-name:&amp;nbsp;Install&amp;nbsp;Dependencies
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run:&amp;nbsp;npm&amp;nbsp;ci
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-name:&amp;nbsp;Build&amp;nbsp;Project
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run:&amp;nbsp;npm&amp;nbsp;run&amp;nbsp;build
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-name:&amp;nbsp;Run&amp;nbsp;Tests
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run:&amp;nbsp;npm&amp;nbsp;run&amp;nbsp;test:ci
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-name:&amp;nbsp;Build&amp;nbsp;Docker&amp;nbsp;Image
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run:&amp;nbsp;docker&amp;nbsp;build&amp;nbsp;-t&amp;nbsp;${{&amp;nbsp;secrets.DOCKER_USER&amp;nbsp;}}/nest-app:${{&amp;nbsp;github.ref_name&amp;nbsp;}}&amp;nbsp;.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-name:&amp;nbsp;Push&amp;nbsp;to&amp;nbsp;Docker&amp;nbsp;Hub
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run:|
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;${{&amp;nbsp;secrets.DOCKER_PASSWORD&amp;nbsp;}}&amp;nbsp;|&amp;nbsp;docker&amp;nbsp;login&amp;nbsp;-u&amp;nbsp;${{&amp;nbsp;secrets.DOCKER_USER&amp;nbsp;}}&amp;nbsp;--password-stdin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docker&amp;nbsp;push&amp;nbsp;${{&amp;nbsp;secrets.DOCKER_USER&amp;nbsp;}}/nest-app:${{&amp;nbsp;github.ref_name&amp;nbsp;}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-name:&amp;nbsp;SSH&amp;nbsp;Deploy
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uses:&amp;nbsp;appleboy/ssh-action@v0.1.10
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;host:&amp;nbsp;${{&amp;nbsp;secrets.PROD_HOST&amp;nbsp;}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;username:&amp;nbsp;${{&amp;nbsp;secrets.PROD_USER&amp;nbsp;}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;key:&amp;nbsp;${{&amp;nbsp;secrets.PROD_SSH_KEY&amp;nbsp;}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;script:|
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docker&amp;nbsp;pull&amp;nbsp;${{&amp;nbsp;secrets.DOCKER_USER&amp;nbsp;}}/nest-app:${{&amp;nbsp;github.ref_name&amp;nbsp;}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docker&amp;nbsp;stop&amp;nbsp;nest-app&amp;nbsp;||&amp;nbsp;true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docker&amp;nbsp;rm&amp;nbsp;nest-app&amp;nbsp;||&amp;nbsp;true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docker&amp;nbsp;run&amp;nbsp;-d&amp;nbsp;\
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--name&amp;nbsp;nest-app&amp;nbsp;\
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--env-file&amp;nbsp;.env.prod&amp;nbsp;\
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-p&amp;nbsp;3000:3000&amp;nbsp;\
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;${{&amp;nbsp;secrets.DOCKER_USER&amp;nbsp;}}/nest-app:${{&amp;nbsp;github.ref_name&amp;nbsp;}}&lt;/pre&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.8 生产环境安全清单&lt;/h5&gt;&lt;blockquote&gt;&lt;p&gt;1. [强制] 禁用Swagger文档（生产环境）&lt;/p&gt;&lt;p&gt;2. [推荐] 配置HTTPS证书（Let&amp;#39;s Encrypt）&lt;/p&gt;&lt;p&gt;3. [重要] 定期备份数据库（每日全量+增量）&lt;/p&gt;&lt;p&gt;4. [必须] 使用防火墙限制端口访问&lt;/p&gt;&lt;p&gt;5. [建议] 实施速率限制（防止暴力破解）&lt;/p&gt;&lt;/blockquote&gt;&lt;h5 style=&quot;   font-weight: 600;  font-size: 16px;      &quot;&gt;10.9 故障排查指南&lt;/h5&gt;&lt;pre class=&quot;brush:bash;toolbar:false&quot;&gt;#&amp;nbsp;查看容器日志
docker&amp;nbsp;logs&amp;nbsp;nest-app&amp;nbsp;--tail100-f
#&amp;nbsp;进入容器调试
dockerexec-it&amp;nbsp;nest-app&amp;nbsp;sh
#&amp;nbsp;性能分析
node--inspect=0.0.0.0:9229&amp;nbsp;dist/main.js
#&amp;nbsp;使用Chrome&amp;nbsp;DevTools连接调试
#&amp;nbsp;内存泄漏检测
NODE_OPTIONS=--max-old-space-size=4096node&amp;nbsp;dist/main.js&lt;/pre&gt;&lt;h4 style=&quot;   font-weight: 600;       &quot;&gt;全系列总结路线图&lt;/h4&gt;&lt;blockquote&gt;&lt;p&gt;1. 项目初始化 -&amp;gt; 基础架构搭建&lt;/p&gt;&lt;p&gt;2. 路由定义 -&amp;gt; 业务功能开发&lt;/p&gt;&lt;p&gt;3. 数据库集成 -&amp;gt; 数据持久化&lt;/p&gt;&lt;p&gt;4. 鉴权体系 -&amp;gt; 安全保障&lt;/p&gt;&lt;p&gt;5. 测试覆盖 -&amp;gt; 质量保障&lt;/p&gt;&lt;p&gt;6. 容器化 -&amp;gt; 部署标准化&lt;/p&gt;&lt;p&gt;7. 监控告警 -&amp;gt; 运维保障&lt;/p&gt;&lt;p&gt;8. 持续交付 -&amp;gt; 自动化流程&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 16 Sep 2025 18:49:22 +0800</pubDate></item><item><title>Javascript实现多类继承</title><link>//www.nswlp.cn/post/353.html</link><description>&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;好像在Javascript中多继承出现的场景并不多，这是因为在es6中并没有显式的支持多继承，不过，如果你认为它不能做到多继承就错了。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;比如有类A、B、C、D，我希望类A去继承B、C、D，那么，可以让B去继承C，C继承D，最后让A继承B，就实现了多继承的效果。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;在es6中，通过&lt;code style=&quot;border: 1px solid rgb(234, 234, 234);  border-radius: 3px;   margin-left: 2px; margin-right: 2px;  font-size: 14px; &quot;&gt;extends&lt;/code&gt;关键字去实现继承，如下示例。&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;class&amp;nbsp;B&amp;nbsp;extends&amp;nbsp;C&amp;nbsp;{}
class&amp;nbsp;C&amp;nbsp;extends&amp;nbsp;D&amp;nbsp;{}&lt;/pre&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;但是，这样一层一层的去写也太麻烦了，那么我们需要了解另一个原理。&lt;/p&gt;&lt;blockquote style=&quot;margin-bottom: 0px; padding: 1em; background: rgb(246, 246, 246); position: relative; color: rgb(51, 51, 51);  font-size: 16px; &quot;&gt;&lt;p style=&quot;line-height: 1.7;  &quot;&gt;&lt;code style=&quot;border: 1px solid rgb(234, 234, 234);  border-radius: 3px;   margin-left: 2px; margin-right: 2px;  font-size: 14px; &quot;&gt;extends&lt;/code&gt;关键字之后除了放一个类或构造函数，还可以是一个Javascript表达式，任何一个可以解析为类或构造函数的表达式都是有效的，它会在求值类定义时被求值。&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;我们把&lt;code style=&quot;border: 1px solid rgb(234, 234, 234);  border-radius: 3px;   margin-left: 2px; margin-right: 2px;  font-size: 14px; &quot;&gt;extends&lt;/code&gt;之后的class改为一个表达式如下。&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;class&amp;nbsp;Parent&amp;nbsp;{}
function&amp;nbsp;getParentClass()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;console.log(&amp;#39;get&amp;nbsp;parent&amp;nbsp;class&amp;#39;)
&amp;nbsp;&amp;nbsp;return&amp;nbsp;Parent;
}
class&amp;nbsp;Child&amp;nbsp;extends&amp;nbsp;getParentClass()&amp;nbsp;{}&lt;/pre&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;所以上述代码片段在控制台打印了&lt;code style=&quot;border: 1px solid rgb(234, 234, 234);  border-radius: 3px;   margin-left: 2px; margin-right: 2px;  font-size: 14px; &quot;&gt;get parent class&lt;/code&gt;。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;基于这个特性，上面B、C、D三个类可以通过混入类的方式来实现效果。我们实现一个混入类的函数，该函数接收一个类作为参数，在函数内部去继承这个传入的类。&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;function&amp;nbsp;Parent()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;console.log(&amp;#39;parent&amp;#39;)
}
const&amp;nbsp;ParentMixin&amp;nbsp;=&amp;nbsp;(SuperClass)&amp;nbsp;=&amp;gt;&amp;nbsp;class&amp;nbsp;extends&amp;nbsp;SuperClass&amp;nbsp;{
&amp;nbsp;&amp;nbsp;parentLog()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(&amp;#39;parent&amp;nbsp;log&amp;#39;)
&amp;nbsp;&amp;nbsp;}
}

const&amp;nbsp;ChildMixin&amp;nbsp;=&amp;nbsp;(SuperClass)&amp;nbsp;=&amp;gt;&amp;nbsp;class&amp;nbsp;extends&amp;nbsp;SuperClass&amp;nbsp;{
&amp;nbsp;&amp;nbsp;childLog()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(&amp;#39;child&amp;nbsp;log&amp;#39;)
&amp;nbsp;&amp;nbsp;}
}

const&amp;nbsp;SubChildMixin&amp;nbsp;=&amp;nbsp;(SuperClass)&amp;nbsp;=&amp;gt;&amp;nbsp;class&amp;nbsp;extends&amp;nbsp;SuperClass&amp;nbsp;{
&amp;nbsp;&amp;nbsp;subChildLog()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(&amp;#39;subchild&amp;nbsp;log&amp;#39;)
&amp;nbsp;&amp;nbsp;}
}

class&amp;nbsp;Base&amp;nbsp;extends&amp;nbsp;SubChildMixin(ChildMixin(ParentMixin(Parent)))&amp;nbsp;{}

const&amp;nbsp;instance&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Base();&amp;nbsp;//&amp;nbsp;parent
instance.subChildLog()&amp;nbsp;//&amp;nbsp;subchild&amp;nbsp;log
instance.childLog()&amp;nbsp;//&amp;nbsp;child&amp;nbsp;log
instance.parentLog()&amp;nbsp;//&amp;nbsp;parent&amp;nbsp;log&lt;/pre&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;这样写的话代码层层套娃不够简单优雅，实现一个辅助&lt;code style=&quot;border: 1px solid rgb(234, 234, 234);  border-radius: 3px;   margin-left: 2px; margin-right: 2px;  font-size: 14px; &quot;&gt;pipe&lt;/code&gt;函数，将函数的嵌套展开。&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;pipe&amp;nbsp;=&amp;nbsp;(...fns)&amp;nbsp;=&amp;gt;&amp;nbsp;(x)&amp;nbsp;=&amp;gt;&amp;nbsp;fns.reduce((v,&amp;nbsp;f)&amp;nbsp;=&amp;gt;&amp;nbsp;f(v),&amp;nbsp;x);

class&amp;nbsp;Base&amp;nbsp;extends&amp;nbsp;pipe(SubChildMixin,&amp;nbsp;ChildMixin,&amp;nbsp;ParentMixin)(Parent)&amp;nbsp;{}&lt;/pre&gt;&lt;h3 style=&quot;margin: 15px 0px; font-size: 20px; color: rgb(51, 51, 51);   &quot;&gt;总结&lt;/h3&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;js多继承的使用场景并不是很多，甚至很多地方已经不建议使用多继承的方式，但是并不妨碍我们了解它的实现原理。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;  line-height: 1.7;   color: rgb(51, 51, 51); font-size: 16px;  &quot;&gt;本文完。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 13 Dec 2022 14:21:09 +0800</pubDate></item><item><title>如何在PHP中调用Python并获取运行结果</title><link>//www.nswlp.cn/post/352.html</link><description>&lt;h2 id=&quot;heading-0&quot; style=&quot;margin-top: 10px; margin-right: 0px; margin-left: 0px; padding: 6px 10px;  font-size: 16px; font-weight: bold; position: relative; color: rgb(255, 255, 255); background: rgb(111, 168, 220); border-radius: 5px;  &quot;&gt;前言&lt;/h2&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;在毕设中需要用到&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;PHP&lt;/code&gt;传递参数调用&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;Python&lt;/code&gt;脚本并获取后者返回的结果，经过查阅资料该问题得以解决。&lt;/p&gt;&lt;p class=&quot;maodian&quot; style=&quot; padding: 0px;  line-height: 30px; height: 1px; overflow: hidden; text-align: right; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;a name=&quot;_label1&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;h2 id=&quot;heading-1&quot; style=&quot;margin-top: 10px; margin-right: 0px; margin-left: 0px; padding: 6px 10px;  font-size: 16px; font-weight: bold; position: relative; color: rgb(255, 255, 255); background: rgb(111, 168, 220); border-radius: 5px;  &quot;&gt;思路&lt;/h2&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;PHP&lt;/code&gt;借助&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;shell_exec&lt;/code&gt;通过类似于&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;python sum.py $aa $bb&lt;/code&gt;的形式以执行系统命令的方式传递参数给&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;Python&lt;/code&gt;文件；&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;Python&lt;/code&gt;则通过&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;sys.argv&lt;/code&gt;（需引入&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;sys&lt;/code&gt;模块）来接收命令中所包含的参数（需要注意的是：此时传入的参数都会被默认为&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;str&lt;/code&gt;类型，需要在函数内部进行解析和转换）并将处理结果通过&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;print&lt;/code&gt;函数输出；&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;PHP&lt;/code&gt;通过将&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;shell_exec&lt;/code&gt;函数返回的结果赋给变量实现取得&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;Python&lt;/code&gt;返回数据的效果。&lt;/p&gt;&lt;p class=&quot;maodian&quot; style=&quot; padding: 0px;  line-height: 30px; height: 1px; overflow: hidden; text-align: right; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;a name=&quot;_label2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;h2 id=&quot;heading-2&quot; style=&quot;margin-top: 10px; margin-right: 0px; margin-left: 0px; padding: 6px 10px;  font-size: 16px; font-weight: bold; position: relative; color: rgb(255, 255, 255); background: rgb(111, 168, 220); border-radius: 5px;  &quot;&gt;代码&lt;/h2&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;PHP&lt;/code&gt;:&lt;/p&gt;&lt;pre class=&quot;brush:php;toolbar:false&quot;&gt;&amp;lt;form&amp;nbsp;action=&amp;quot;&amp;quot;&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;请输入a:&amp;lt;input&amp;nbsp;type=&amp;quot;number&amp;quot;&amp;nbsp;name=&amp;quot;a&amp;quot;&amp;nbsp;value=&amp;quot;请输入a&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;nbsp;请输入b:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;number&amp;quot;&amp;nbsp;name=&amp;quot;b&amp;quot;&amp;nbsp;value=&amp;quot;请输入b&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;button&amp;nbsp;type=&amp;quot;submit&amp;quot;&amp;gt;计算&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;?php
$aa&amp;nbsp;=&amp;nbsp;$_POST[&amp;quot;a&amp;quot;];
$bb&amp;nbsp;=&amp;nbsp;$_POST[&amp;quot;b&amp;quot;];
$cmd&amp;nbsp;=&amp;nbsp;shell_exec(&amp;quot;python&amp;nbsp;sum.py&amp;nbsp;$aa&amp;nbsp;$bb&amp;quot;);
echo&amp;nbsp;&amp;quot;a与b的和是：&amp;nbsp;$cmd&amp;quot;;
?&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px; &quot;&gt;Python&lt;/code&gt;&lt;span style=&quot;color: rgb(34, 34, 34);  font-size: 16px; &quot;&gt;:&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;import&amp;nbsp;sys
&amp;nbsp;
a,&amp;nbsp;b&amp;nbsp;=&amp;nbsp;sys.argv[1],&amp;nbsp;sys.argv[2]&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;接收位置参数
print(int(a)+int(b))&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(34, 34, 34);  font-size: 16px; &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 id=&quot;heading-3&quot; style=&quot;margin-top: 10px; margin-right: 0px; margin-left: 0px; padding: 6px 10px;  font-size: 16px; font-weight: bold; position: relative; color: rgb(255, 255, 255); background: rgb(111, 168, 220); border-radius: 5px;  &quot;&gt;效果&lt;/h2&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;   text-align: center;&quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/20221213140609_69611.gif&quot;/&gt;&lt;/p&gt;&lt;p class=&quot;maodian&quot; style=&quot; padding: 0px;  line-height: 30px; height: 1px; overflow: hidden; text-align: right; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;a name=&quot;_label4&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;h2 id=&quot;heading-4&quot; style=&quot;margin-top: 10px; margin-right: 0px; margin-left: 0px; padding: 6px 10px;  font-size: 16px; font-weight: bold; position: relative; color: rgb(255, 255, 255); background: rgb(111, 168, 220); border-radius: 5px;  &quot;&gt;补充&lt;/h2&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;Python&lt;/code&gt;:&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;除了&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;sys.argv&lt;/code&gt;，&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;Python&lt;/code&gt;还可以通过&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;argparse&lt;/code&gt;、&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.run&lt;/code&gt;获取传入参数。&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;相对于&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;sys.argv&lt;/code&gt;，&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;argparse&lt;/code&gt;和&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.run&lt;/code&gt;可以认为是&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;基于参数名称的传入&lt;/code&gt;（前者是&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;基于位置的参数传入&lt;/code&gt;）。&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;后者的具体使用方法记录如下：&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;argparse&lt;/code&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;示例1：&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;import&amp;nbsp;argparse
parser&amp;nbsp;=&amp;nbsp;argparse.ArgumentParser(description=&amp;#39;manual&amp;nbsp;to&amp;nbsp;this&amp;nbsp;script&amp;#39;)
parser.add_argument(&amp;#39;--gpus&amp;#39;,&amp;nbsp;type=str,&amp;nbsp;default&amp;nbsp;=&amp;nbsp;None)
parser.add_argument(&amp;#39;--batch-size&amp;#39;,&amp;nbsp;type=int,&amp;nbsp;default=32)
args&amp;nbsp;=&amp;nbsp;parser.parse_args()
print&amp;nbsp;args.gpus
print&amp;nbsp;args.batch_size&lt;/pre&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;利用&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;argparse&lt;/code&gt;模块，在函数内定义好相关的命名参数（包括名称、数据类型和默认值等），从而在命令行中可以方便的调用。&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;需要注意的是，脚本运行命令&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;python script.py -gpus=0,1,2 --batch-size=10&lt;/code&gt;中的&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;--batch-size&lt;/code&gt;会被自动解析成&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;batch_size&lt;/code&gt;.&lt;br/&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;parser.add_argument&lt;/code&gt;&amp;nbsp;方法的&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;type&lt;/code&gt;参数理论上可以是任何合法的类型， 但有些参数传入格式比较麻烦，例如&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;list&lt;/code&gt;，所以一般使用&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;bool&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;int&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;str&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;float&lt;/code&gt;这些基本类型就行了，更复杂的需求可以通过&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;str&lt;/code&gt;传入，然后手动解析。&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;bool&lt;/code&gt;类型的解析比较特殊，传入任何值都会被解析成&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;True&lt;/code&gt;，传入空值时才为&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;False&lt;/code&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;python&amp;nbsp;script.py&amp;nbsp;--bool-val=0&amp;nbsp;#&amp;nbsp;args.bool_val=True
python&amp;nbsp;script.py&amp;nbsp;--bool-val=False&amp;nbsp;#&amp;nbsp;args.bool_val=True
python&amp;nbsp;script.py&amp;nbsp;--bool-val=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;args.bool_val=什么都不写False&lt;/pre&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;示例2：&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;Python:&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;import&amp;nbsp;argparse
&amp;nbsp;
parser&amp;nbsp;=&amp;nbsp;argparse.ArgumentParser(description=&amp;#39;a&amp;nbsp;demo&amp;nbsp;of&amp;nbsp;script&amp;#39;)
parser.add_argument(&amp;#39;--a&amp;#39;,&amp;nbsp;type=float,&amp;nbsp;default=0.0)&amp;nbsp;&amp;nbsp;#&amp;nbsp;添加变量
parser.add_argument(&amp;#39;--b&amp;#39;,&amp;nbsp;type=float,&amp;nbsp;default=1.0)
&amp;nbsp;
if&amp;nbsp;__name__&amp;nbsp;==&amp;nbsp;&amp;#39;__main__&amp;#39;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;args&amp;nbsp;=&amp;nbsp;parser.parse_args()&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;解析所有的命令行传入变量
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;add(args.a,&amp;nbsp;args.b)&lt;/pre&gt;&lt;p&gt;&lt;strong style=&quot;color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;Shell:&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;python&amp;nbsp;script.py&amp;nbsp;--a=4.0&amp;nbsp;--b=3.0
#&amp;nbsp;&amp;nbsp;另一种写法：&amp;nbsp;python&amp;nbsp;script.py&amp;nbsp;--a&amp;nbsp;4.0&amp;nbsp;--b&amp;nbsp;3.0
#　返回结果7.0&lt;/pre&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;总结：通过这个方法还能指定命令的帮助信息。具体请看&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;API&lt;/code&gt;文档：&lt;a href=&quot;https://docs.python.org/2/library/argparse.html&quot; rel=&quot;external nofollow&quot; target=&quot;_blank&quot; style=&quot;color: rgb(66, 139, 202);&quot;&gt;https://docs.python.org/2/library/argparse.html&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;通过这个方法还能指定命令的帮助信息。具体请看&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;API&lt;/code&gt;文档：&lt;a href=&quot;https://docs.python.org/2/library/argparse.html&quot; rel=&quot;external nofollow&quot; target=&quot;_blank&quot; style=&quot;color: rgb(66, 139, 202);&quot;&gt;https://docs.python.org/2/library/argparse.html&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;maodian&quot; style=&quot; padding: 0px;  line-height: 30px; height: 1px; overflow: hidden; text-align: right; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;a name=&quot;_lab2_4_0&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;h3 id=&quot;heading-5&quot; style=&quot;margin: 10px 0px 8px; padding: 6px 10px;  font-size: 16px; font-weight: bold; position: relative; color: rgb(13, 90, 150); background: rgb(241, 247, 253); border-width: 1px 1px 1px 3px; border-style: dashed dashed dashed solid; border-color: rgb(202, 224, 243) rgb(202, 224, 243) rgb(202, 224, 243) rgb(73, 167, 234); border-image: initial;  &quot;&gt;tf.app.run&lt;/h3&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tensorflow&lt;/code&gt;也提供了一种方便的解析方式。&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;脚本的执行命令为：&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;python&amp;nbsp;script.py&amp;nbsp;-gpus=0,1,2&amp;nbsp;--batch_size=10&lt;/pre&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;对应的python代码为：&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;import&amp;nbsp;tensorflow&amp;nbsp;as&amp;nbsp;tf
tf.app.flags.DEFINE_string(&amp;#39;gpus&amp;#39;,&amp;nbsp;None,&amp;nbsp;&amp;#39;gpus&amp;nbsp;to&amp;nbsp;use&amp;#39;)
tf.app.flags.DEFINE_integer(&amp;#39;batch_size&amp;#39;,&amp;nbsp;5,&amp;nbsp;&amp;#39;batch&amp;nbsp;size&amp;#39;)
&amp;nbsp;
FLAGS&amp;nbsp;=&amp;nbsp;tf.app.flags.FLAGS
&amp;nbsp;
def&amp;nbsp;main(_):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print&amp;nbsp;FLAGS.gpus
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print&amp;nbsp;FLAGS.batch_size
&amp;nbsp;
if&amp;nbsp;__name__==&amp;quot;__main__&amp;quot;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tf.app.run()&lt;/pre&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;有几点需要注意：&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tensorflow&lt;/code&gt;只&lt;strong&gt;提供以下几种方法：&lt;/strong&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: decimal;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.flags.DEFINE_string&lt;/code&gt;，&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.flags.DEFINE_integer&lt;/code&gt;,&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.flags.DEFINE_boolean&lt;/code&gt;,&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.flags.DEFINE_float&lt;/code&gt;&amp;nbsp;四种方法，分别对应&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;str&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;int&lt;/code&gt;,&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;bool&lt;/code&gt;,&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;float&lt;/code&gt;类型的参数。这里对&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;bool&lt;/code&gt;的解析比较严格，传入&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;1&lt;/code&gt;会被解析成&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;True&lt;/code&gt;，其余任何值都会被解析成&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;False&lt;/code&gt;。&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;脚本中需要定义一个接收一个参数的&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;main&lt;/code&gt;方法：&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;def main(_):&lt;/code&gt;，这个传入的参数是脚本名，一般用不到， 所以用下划线接收。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;以&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;batch_size&lt;/code&gt;参数为例，传入这个参数时使用的名称为&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;--batch_size&lt;/code&gt;，也就是说，中划线不会像在&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;argparse&lt;/code&gt;&amp;nbsp;中一样被解析成下划线。&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.run()&lt;/code&gt;会寻找并执行入口脚本的&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;main&lt;/code&gt;方法。也只有在执行了&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.run()&lt;/code&gt;之后才能从&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;FLAGS&lt;/code&gt;中取出参数。&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;从它的签名来看，它也是可以自己指定需要执行的方法的，不一定非得叫&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;main&lt;/code&gt;：&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;run(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;main=None,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;argv=None
)&lt;/pre&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;tf.app.flags&lt;/code&gt;只是对&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;argpars&lt;/code&gt;的简单封装。&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;代码：&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;#&amp;nbsp;Copyright&amp;nbsp;2015&amp;nbsp;The&amp;nbsp;TensorFlow&amp;nbsp;Authors.&amp;nbsp;All&amp;nbsp;Rights&amp;nbsp;Reserved.
#
#&amp;nbsp;Licensed&amp;nbsp;under&amp;nbsp;the&amp;nbsp;Apache&amp;nbsp;License,&amp;nbsp;Version&amp;nbsp;2.0&amp;nbsp;(the&amp;nbsp;&amp;quot;License&amp;quot;);
#&amp;nbsp;you&amp;nbsp;may&amp;nbsp;not&amp;nbsp;use&amp;nbsp;this&amp;nbsp;file&amp;nbsp;except&amp;nbsp;in&amp;nbsp;compliance&amp;nbsp;with&amp;nbsp;the&amp;nbsp;License.
#&amp;nbsp;You&amp;nbsp;may&amp;nbsp;obtain&amp;nbsp;a&amp;nbsp;copy&amp;nbsp;of&amp;nbsp;the&amp;nbsp;License&amp;nbsp;at
#
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;http://www.apache.org/licenses/LICENSE-2.0
#
#&amp;nbsp;Unless&amp;nbsp;required&amp;nbsp;by&amp;nbsp;applicable&amp;nbsp;law&amp;nbsp;or&amp;nbsp;agreed&amp;nbsp;to&amp;nbsp;in&amp;nbsp;writing,&amp;nbsp;software
#&amp;nbsp;distributed&amp;nbsp;under&amp;nbsp;the&amp;nbsp;License&amp;nbsp;is&amp;nbsp;distributed&amp;nbsp;on&amp;nbsp;an&amp;nbsp;&amp;quot;AS&amp;nbsp;IS&amp;quot;&amp;nbsp;BASIS,
#&amp;nbsp;WITHOUT&amp;nbsp;WARRANTIES&amp;nbsp;OR&amp;nbsp;CONDITIONS&amp;nbsp;OF&amp;nbsp;ANY&amp;nbsp;KIND,&amp;nbsp;either&amp;nbsp;express&amp;nbsp;or&amp;nbsp;implied.
#&amp;nbsp;See&amp;nbsp;the&amp;nbsp;License&amp;nbsp;for&amp;nbsp;the&amp;nbsp;specific&amp;nbsp;language&amp;nbsp;governing&amp;nbsp;permissions&amp;nbsp;and
#&amp;nbsp;limitations&amp;nbsp;under&amp;nbsp;the&amp;nbsp;License.
#&amp;nbsp;==============================================================================
&amp;nbsp;
&amp;quot;&amp;quot;&amp;quot;Implementation&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flags&amp;nbsp;interface.&amp;quot;&amp;quot;&amp;quot;
from&amp;nbsp;__future__&amp;nbsp;import&amp;nbsp;absolute_import
from&amp;nbsp;__future__&amp;nbsp;import&amp;nbsp;division
from&amp;nbsp;__future__&amp;nbsp;import&amp;nbsp;print_function
import&amp;nbsp;argparse&amp;nbsp;as&amp;nbsp;_argparse
from&amp;nbsp;tensorflow.python.util.all_util&amp;nbsp;import&amp;nbsp;remove_undocumented
_global_parser&amp;nbsp;=&amp;nbsp;_argparse.ArgumentParser()
&amp;nbsp;
#&amp;nbsp;pylint:&amp;nbsp;disable=invalid-name
&amp;nbsp;
class&amp;nbsp;_FlagValues(object):
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Global&amp;nbsp;container&amp;nbsp;and&amp;nbsp;accessor&amp;nbsp;for&amp;nbsp;flags&amp;nbsp;and&amp;nbsp;their&amp;nbsp;values.&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;def&amp;nbsp;__init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.__dict__[&amp;#39;__flags&amp;#39;]&amp;nbsp;=&amp;nbsp;{}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.__dict__[&amp;#39;__parsed&amp;#39;]&amp;nbsp;=&amp;nbsp;False
&amp;nbsp;
&amp;nbsp;&amp;nbsp;def&amp;nbsp;_parse_flags(self,&amp;nbsp;args=None):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result,&amp;nbsp;unparsed&amp;nbsp;=&amp;nbsp;_global_parser.parse_known_args(args=args)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;flag_name,&amp;nbsp;val&amp;nbsp;in&amp;nbsp;vars(result).items():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.__dict__[&amp;#39;__flags&amp;#39;][flag_name]&amp;nbsp;=&amp;nbsp;val
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.__dict__[&amp;#39;__parsed&amp;#39;]&amp;nbsp;=&amp;nbsp;True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;unparsed
&amp;nbsp;
&amp;nbsp;&amp;nbsp;def&amp;nbsp;__getattr__(self,&amp;nbsp;name):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Retrieves&amp;nbsp;the&amp;nbsp;&amp;#39;value&amp;#39;&amp;nbsp;attribute&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;--name.&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;not&amp;nbsp;self.__dict__[&amp;#39;__parsed&amp;#39;]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self._parse_flags()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;name&amp;nbsp;not&amp;nbsp;in&amp;nbsp;self.__dict__[&amp;#39;__flags&amp;#39;]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;raise&amp;nbsp;AttributeError(name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;self.__dict__[&amp;#39;__flags&amp;#39;][name]
&amp;nbsp;
&amp;nbsp;&amp;nbsp;def&amp;nbsp;__setattr__(self,&amp;nbsp;name,&amp;nbsp;value):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Sets&amp;nbsp;the&amp;nbsp;&amp;#39;value&amp;#39;&amp;nbsp;attribute&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;--name.&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;not&amp;nbsp;self.__dict__[&amp;#39;__parsed&amp;#39;]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self._parse_flags()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.__dict__[&amp;#39;__flags&amp;#39;][name]&amp;nbsp;=&amp;nbsp;value
&amp;nbsp;
def&amp;nbsp;_define_helper(flag_name,&amp;nbsp;default_value,&amp;nbsp;docstring,&amp;nbsp;flagtype):
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Registers&amp;nbsp;&amp;#39;flag_name&amp;#39;&amp;nbsp;with&amp;nbsp;&amp;#39;default_value&amp;#39;&amp;nbsp;and&amp;nbsp;&amp;#39;docstring&amp;#39;.&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;_global_parser.add_argument(&amp;#39;--&amp;#39;&amp;nbsp;+&amp;nbsp;flag_name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default=default_value,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;help=docstring,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type=flagtype)
&amp;nbsp;
&amp;nbsp;
#&amp;nbsp;Provides&amp;nbsp;the&amp;nbsp;global&amp;nbsp;object&amp;nbsp;that&amp;nbsp;can&amp;nbsp;be&amp;nbsp;used&amp;nbsp;to&amp;nbsp;access&amp;nbsp;flags.
FLAGS&amp;nbsp;=&amp;nbsp;_FlagValues()
&amp;nbsp;
&amp;nbsp;
def&amp;nbsp;DEFINE_string(flag_name,&amp;nbsp;default_value,&amp;nbsp;docstring):
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Defines&amp;nbsp;a&amp;nbsp;flag&amp;nbsp;of&amp;nbsp;type&amp;nbsp;&amp;#39;string&amp;#39;.
&amp;nbsp;&amp;nbsp;Args:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;flag_name:&amp;nbsp;The&amp;nbsp;name&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;as&amp;nbsp;a&amp;nbsp;string.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default_value:&amp;nbsp;The&amp;nbsp;default&amp;nbsp;value&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;should&amp;nbsp;take&amp;nbsp;as&amp;nbsp;a&amp;nbsp;string.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docstring:&amp;nbsp;A&amp;nbsp;helpful&amp;nbsp;message&amp;nbsp;explaining&amp;nbsp;the&amp;nbsp;use&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag.
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;_define_helper(flag_name,&amp;nbsp;default_value,&amp;nbsp;docstring,&amp;nbsp;str)
&amp;nbsp;
&amp;nbsp;
def&amp;nbsp;DEFINE_integer(flag_name,&amp;nbsp;default_value,&amp;nbsp;docstring):
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Defines&amp;nbsp;a&amp;nbsp;flag&amp;nbsp;of&amp;nbsp;type&amp;nbsp;&amp;#39;int&amp;#39;.
&amp;nbsp;&amp;nbsp;Args:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;flag_name:&amp;nbsp;The&amp;nbsp;name&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;as&amp;nbsp;a&amp;nbsp;string.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default_value:&amp;nbsp;The&amp;nbsp;default&amp;nbsp;value&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;should&amp;nbsp;take&amp;nbsp;as&amp;nbsp;an&amp;nbsp;int.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docstring:&amp;nbsp;A&amp;nbsp;helpful&amp;nbsp;message&amp;nbsp;explaining&amp;nbsp;the&amp;nbsp;use&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag.
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;_define_helper(flag_name,&amp;nbsp;default_value,&amp;nbsp;docstring,&amp;nbsp;int)
&amp;nbsp;
&amp;nbsp;
def&amp;nbsp;DEFINE_boolean(flag_name,&amp;nbsp;default_value,&amp;nbsp;docstring):
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Defines&amp;nbsp;a&amp;nbsp;flag&amp;nbsp;of&amp;nbsp;type&amp;nbsp;&amp;#39;boolean&amp;#39;.
&amp;nbsp;&amp;nbsp;Args:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;flag_name:&amp;nbsp;The&amp;nbsp;name&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;as&amp;nbsp;a&amp;nbsp;string.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default_value:&amp;nbsp;The&amp;nbsp;default&amp;nbsp;value&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;should&amp;nbsp;take&amp;nbsp;as&amp;nbsp;a&amp;nbsp;boolean.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docstring:&amp;nbsp;A&amp;nbsp;helpful&amp;nbsp;message&amp;nbsp;explaining&amp;nbsp;the&amp;nbsp;use&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag.
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;#&amp;nbsp;Register&amp;nbsp;a&amp;nbsp;custom&amp;nbsp;function&amp;nbsp;for&amp;nbsp;&amp;#39;bool&amp;#39;&amp;nbsp;so&amp;nbsp;--flag=True&amp;nbsp;works.
&amp;nbsp;&amp;nbsp;def&amp;nbsp;str2bool(v):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;v.lower()&amp;nbsp;in&amp;nbsp;(&amp;#39;true&amp;#39;,&amp;nbsp;&amp;#39;t&amp;#39;,&amp;nbsp;&amp;#39;1&amp;#39;)
&amp;nbsp;&amp;nbsp;_global_parser.add_argument(&amp;#39;--&amp;#39;&amp;nbsp;+&amp;nbsp;flag_name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nargs=&amp;#39;?&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const=True,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;help=docstring,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default=default_value,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type=str2bool)
&amp;nbsp;
&amp;nbsp;&amp;nbsp;#&amp;nbsp;Add&amp;nbsp;negated&amp;nbsp;version,&amp;nbsp;stay&amp;nbsp;consistent&amp;nbsp;with&amp;nbsp;argparse&amp;nbsp;with&amp;nbsp;regard&amp;nbsp;to
&amp;nbsp;&amp;nbsp;#&amp;nbsp;dashes&amp;nbsp;in&amp;nbsp;flag&amp;nbsp;names.
&amp;nbsp;&amp;nbsp;_global_parser.add_argument(&amp;#39;--no&amp;#39;&amp;nbsp;+&amp;nbsp;flag_name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;action=&amp;#39;store_false&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dest=flag_name.replace(&amp;#39;-&amp;#39;,&amp;nbsp;&amp;#39;_&amp;#39;))
&amp;nbsp;
&amp;nbsp;
#&amp;nbsp;The&amp;nbsp;internal&amp;nbsp;google&amp;nbsp;library&amp;nbsp;defines&amp;nbsp;the&amp;nbsp;following&amp;nbsp;alias,&amp;nbsp;so&amp;nbsp;we&amp;nbsp;match
#&amp;nbsp;the&amp;nbsp;API&amp;nbsp;for&amp;nbsp;consistency.
DEFINE_bool&amp;nbsp;=&amp;nbsp;DEFINE_boolean&amp;nbsp;&amp;nbsp;#&amp;nbsp;pylint:&amp;nbsp;disable=invalid-name
&amp;nbsp;
&amp;nbsp;
def&amp;nbsp;DEFINE_float(flag_name,&amp;nbsp;default_value,&amp;nbsp;docstring):
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Defines&amp;nbsp;a&amp;nbsp;flag&amp;nbsp;of&amp;nbsp;type&amp;nbsp;&amp;#39;float&amp;#39;.
&amp;nbsp;&amp;nbsp;Args:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;flag_name:&amp;nbsp;The&amp;nbsp;name&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;as&amp;nbsp;a&amp;nbsp;string.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default_value:&amp;nbsp;The&amp;nbsp;default&amp;nbsp;value&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;should&amp;nbsp;take&amp;nbsp;as&amp;nbsp;a&amp;nbsp;float.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;docstring:&amp;nbsp;A&amp;nbsp;helpful&amp;nbsp;message&amp;nbsp;explaining&amp;nbsp;the&amp;nbsp;use&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flag.
&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;_define_helper(flag_name,&amp;nbsp;default_value,&amp;nbsp;docstring,&amp;nbsp;float)
&amp;nbsp;
_allowed_symbols&amp;nbsp;=&amp;nbsp;[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;We&amp;nbsp;rely&amp;nbsp;on&amp;nbsp;gflags&amp;nbsp;documentation.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;DEFINE_bool&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;DEFINE_boolean&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;DEFINE_float&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;DEFINE_integer&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;DEFINE_string&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;FLAGS&amp;#39;,
]
remove_undocumented(__name__,&amp;nbsp;_allowed_symbols)&lt;/pre&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;PHP&lt;/code&gt;:&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;除了使用&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;shell_exec()&lt;/code&gt;，还可以使用&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;exec()&lt;/code&gt;、&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;passthru()&lt;/code&gt;和&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;system()&lt;/code&gt;函数调用系统命令，&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;它们四者的区别如下：&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;shell_exec()&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;通过&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;shell&lt;/code&gt;&amp;nbsp;环境执行命令，并且将完整的输出以字符串的方式返回。&lt;br/&gt;也就是说,&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;PHP&lt;/code&gt;先运行一个&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;shell&lt;/code&gt;环境, 然后让&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;shell&lt;/code&gt;进程运行你的命令, 并且把所有输出以字符串形式返回, 如果程序执行有错误或者程序没有任何输出, 则返回&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;null&lt;/code&gt;.&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;exec()&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253); line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;string exec ( string $command [, array &amp;amp;$output [, int &amp;amp;$return_var ]] )&lt;/code&gt;与&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;shell_exec()&lt;/code&gt;&amp;nbsp;不一样,&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;exec&lt;/code&gt;不会创建&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;shell&lt;/code&gt;进程, 可以理解是&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;php&lt;/code&gt;进程直接创建一个子进程, 运行指定的命令, 返回值只返回命令的最后一行, 所有的返回以参数形式返回, 上面的&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;$output&lt;/code&gt;, 进程的退出代码以另外一个参数变量返回, 上面的&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;$return_var&lt;/code&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;passthru()&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;void passthru ( string $command [, int &amp;amp;$return_var ] )&lt;/code&gt;与&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;exec()&lt;/code&gt;&amp;nbsp;类似, 唯一不同的是, 命令的所有输出返回内容都不再导入到&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;PHP&lt;/code&gt;&amp;nbsp;环境, 而是直接作为输出内容, 返回到浏览器的输出上, 等效是把所有返回内容直接&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;echo&lt;/code&gt;&amp;nbsp;输出.&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;&lt;strong&gt;system()&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot; padding: 3px 0px;  line-height: 30px; color: rgb(34, 34, 34);  font-size: 16px;  &quot;&gt;这个方法和&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;passthru()&lt;/code&gt;&amp;nbsp;类似, 但是&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;system()&lt;/code&gt;&amp;nbsp;方法会在程序的每行输出的时候执行一次缓存输出动作, 可以理解为, 只要外部程序输出一行,&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;php&lt;/code&gt;&amp;nbsp;就会马上把内容推送到浏览器, 无论这个内容是否足够大.&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;php&lt;/code&gt;通常为了输出效率, 都会有一个输出缓存, 会等到输出内容足够大之后, 再一次输出返回.&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;system()&lt;/code&gt;&amp;nbsp;方法则强制输出内容立刻推送, 即使输出的内容只有一个字母. 如果客户端具有实时打印服务器的返回&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;http&lt;/code&gt;&amp;nbsp;内容流的能力, 就可以看到&amp;nbsp;&lt;code style=&quot;margin: 0px 0.3em; padding: 0.2em 0.6em;  font-style: inherit;  background: rgb(235, 245, 253);  line-height: 1.5; clear: both; font-size: 14px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); border-radius: 3px;&quot;&gt;system()&lt;/code&gt;&amp;nbsp;的实时推送效果.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 13 Dec 2022 13:55:32 +0800</pubDate></item><item><title>PHP 中调用 Python 并获取运行结果</title><link>//www.nswlp.cn/post/351.html</link><description>&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;这里就要用到PHP的内置函数exec() 和system() ；&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;strong&gt;PHP的exec() 和system() 函数区别：&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（1）system()&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;原型：string system (string command [, int return_var])&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;system()函数很其它语言中的差不多，它执行给定的命令，输出和返回结果。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（2）exec()&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;原型：string exec (string command [, string array [, int return_var]])&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;exec ()函数与system()类似，也执行给定的命令，但不输出结果，而是返回结果的最后一行。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;可以看出两个函数的区别就是PHP在调用执行外部命令后，system()函数将执行的结果输出并返回给PHP程序。而 exec() 函数在调用执行外部命令后不会将结果输出，只是返回结果。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;strong&gt;程序代码实现和对比：&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（1）in.php程序使用exec()函数代码及解析：&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/326d742963e049eb1a497e4e34d09922.jpg&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（2）test.py程序代码：&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/2bfaedcfd776a89e49790d17549be171.jpg&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（3）PHP程序执行后效果1：&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/076cc8c82f1f98dcc04a031d7d065e33.jpg&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;这样就利用exec()函数实现了对python脚本的调用，下面说一下将in.php程序中的exec()函数替换成system()函数后的执行效果。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（4）in.php程序使用system()函数代码及解析：&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/572aa270a27407ba45bea34255fd6671.jpg&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（5）PHP程序执行后效果2：&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/c9f32adc03d94d125ae262d024fe5d2a.jpg&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;可以看出使用system()函数时，执行python程序时不但返回结果，而且将结果输出了，而exec()函数只是返回结果，没有输出。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;strong&gt;扩展应用：（php web开发数据调用）&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;想要在网页上显示其它网站上的数据内容时，都需要网站提供数据的调用接口直接调用，如果没有接口，就需要用爬虫将数据爬回来后保存到数据库，在用程序从数据库中取出数据展示出来。（当然也可以用到php的curl库进行数据爬取后进行展示，但是个人认为在编程语言中做爬虫最简单并且强大的还是Python），而如果在PHP程序中直接调用python脚本进行爬虫，然后再将数据展示到网页上，这样就可以省去插入数据到数据库和从数据库读取数据的过程，这种做法对一些实时数据的爬取还是比较有用的，但是一定会影响网页的加载速度。下面将以前写的一个爬虫爬到的数据直接展示到web网页上供大家参考。&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（1）php程序代码：&lt;/p&gt;&lt;pre class=&quot;brush:php;toolbar:false&quot;&gt;&amp;lt;?PHP
$output=exec(&amp;#39;python&amp;nbsp;test1.py&amp;#39;);
echo&amp;nbsp;$output;
?&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(43, 51, 59); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, Tahoma, Arial, sans-serif; &quot;&gt;（2）python爬虫代码：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;import&amp;nbsp;requests
import&amp;nbsp;json
class&amp;nbsp;WeatherSpider(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def&amp;nbsp;__inti__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def&amp;nbsp;request(self,url):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;headers&amp;nbsp;=&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;User-Agent&amp;#39;:&amp;#39;Mozilla/5.0&amp;nbsp;(Windows&amp;nbsp;NT&amp;nbsp;6.1;&amp;nbsp;WOW64)&amp;nbsp;AppleWebKit/537.36&amp;nbsp;(KHTML,&amp;nbsp;like&amp;nbsp;Gecko)&amp;nbsp;Chrome/55.0.2883.87&amp;nbsp;Safari/537.36&amp;#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;Referer&amp;#39;:&amp;nbsp;&amp;#39;http://www.weather.com.cn/weather40d/101060201.shtml&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;requests.get(url,headers=headers)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def&amp;nbsp;create_url(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;year&amp;nbsp;=&amp;nbsp;&amp;#39;2016&amp;#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;i&amp;nbsp;in&amp;nbsp;range(1,2):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;month&amp;nbsp;=&amp;nbsp;str(i)&amp;nbsp;if&amp;nbsp;i&amp;nbsp;&amp;gt;&amp;nbsp;9&amp;nbsp;else&amp;nbsp;&amp;quot;0&amp;quot;&amp;nbsp;+&amp;nbsp;str(i)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;url&amp;nbsp;=&amp;nbsp;&amp;quot;http://d1.weather.com.cn/calendar_new/&amp;quot;&amp;nbsp;+&amp;nbsp;year&amp;nbsp;+&amp;nbsp;&amp;quot;/101060201_&amp;quot;&amp;nbsp;+&amp;nbsp;year&amp;nbsp;+&amp;nbsp;month&amp;nbsp;+&amp;nbsp;&amp;quot;.html&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.get_data(url)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def&amp;nbsp;get_data(self,url):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;respone&amp;nbsp;=&amp;nbsp;self.request(url).content
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;json_str&amp;nbsp;=&amp;nbsp;respone.decode(encoding=&amp;#39;utf-8&amp;#39;)[11:]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;weathers&amp;nbsp;=&amp;nbsp;json.loads(json_str)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;weather&amp;nbsp;in&amp;nbsp;weathers:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data&amp;nbsp;=&amp;nbsp;data+weather.get(&amp;#39;date&amp;#39;)+&amp;#39;星期&amp;#39;+weather.get(&amp;#39;wk&amp;#39;)+weather.get(&amp;#39;hmax&amp;#39;)+weather.get(&amp;#39;hmin&amp;#39;)+weather.get(&amp;#39;hgl&amp;#39;)+&amp;quot;&amp;lt;br&amp;gt;&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print&amp;nbsp;(data)
if&amp;nbsp;__name__&amp;nbsp;==&amp;nbsp;&amp;#39;__main__&amp;#39;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;jl_weather&amp;nbsp;=&amp;nbsp;WeatherSpider()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;jl_weather.create_url()&lt;/pre&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;（3）web网页爬虫展示：&lt;/p&gt;&lt;p style=&quot;margin-top: 10px;   color: rgb(43, 51, 59); &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/974c4ef878790f6841d2299b90a68489.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h1 style=&quot; margin-top: 8px; margin-bottom: 16px;  font-weight: 600;  font-size: 24px; color: rgb(79, 79, 79); line-height: 32px;    &quot;&gt;Python sys.argv&lt;/h1&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;PHP 借助&amp;nbsp;&lt;code style=&quot;  font-size: 14px; line-height: 22px; border-radius: 2px; &quot;&gt;shell_exec&lt;/code&gt;&amp;nbsp;通过类似于&amp;nbsp;&lt;code style=&quot;  font-size: 14px; line-height: 22px; border-radius: 2px; &quot;&gt;python sum.py $aa $bb&lt;/code&gt;&amp;nbsp;的形式以执行系统命令的方式传递参数给Python文件；&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;Python 则通过&amp;nbsp;&lt;code style=&quot;  font-size: 14px; line-height: 22px; border-radius: 2px; &quot;&gt;sys.argv（需引入sys模块）&lt;/code&gt;&amp;nbsp;来接收命令中所包含的参数（需要注意的是：此时传入的参数都会被默认为&amp;nbsp;&lt;code style=&quot;  font-size: 14px; line-height: 22px; border-radius: 2px; &quot;&gt;str&lt;/code&gt;&amp;nbsp;类型，需要在函数内部进行解析和转换）并将处理结果通过&lt;code style=&quot;  font-size: 14px; line-height: 22px; border-radius: 2px; &quot;&gt;print&lt;/code&gt;&amp;nbsp;函数输出；&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;PHP 通过将 shell_exec 函数返回的结果赋给变量实现取得 Python 返回数据的效果。&lt;/p&gt;&lt;h2 style=&quot; margin: 8px 0px 16px;  font-weight: 600;  font-size: 22px; color: rgb(79, 79, 79); line-height: 30px;    &quot;&gt;php index.php&lt;/h2&gt;&lt;pre class=&quot;brush:php;toolbar:false&quot;&gt;&amp;lt;form&amp;nbsp;action=&amp;quot;&amp;quot;&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;请输入a:&amp;lt;input&amp;nbsp;type=&amp;quot;number&amp;quot;&amp;nbsp;name=&amp;quot;a&amp;quot;&amp;nbsp;value=&amp;quot;请输入a&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;nbsp;请输入b:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;number&amp;quot;&amp;nbsp;name=&amp;quot;b&amp;quot;&amp;nbsp;value=&amp;quot;请输入b&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;button&amp;nbsp;type=&amp;quot;submit&amp;quot;&amp;gt;计算&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;?php
$aa&amp;nbsp;=&amp;nbsp;$_POST[&amp;quot;a&amp;quot;];
$bb&amp;nbsp;=&amp;nbsp;$_POST[&amp;quot;b&amp;quot;];
$cmd&amp;nbsp;=&amp;nbsp;shell_exec(&amp;quot;python&amp;nbsp;sum.py&amp;nbsp;$aa&amp;nbsp;$bb&amp;quot;);
echo&amp;nbsp;&amp;quot;a与b的和是：&amp;nbsp;$cmd&amp;quot;;&lt;/pre&gt;&lt;h2 style=&quot; margin: 8px 0px 16px;  font-weight: 600;  font-size: 22px; color: rgb(79, 79, 79); line-height: 30px;    &quot;&gt;python sum.py&lt;/h2&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;import&amp;nbsp;sys

#&amp;nbsp;以下两行解决中文乱码问题
import&amp;nbsp;codecs
sys.stdout&amp;nbsp;=&amp;nbsp;codecs.getwriter(&amp;#39;utf-8&amp;#39;)(sys.stdout.detach())

a,&amp;nbsp;b&amp;nbsp;=&amp;nbsp;sys.argv[1],&amp;nbsp;sys.argv[2]&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;接收位置参数
print(int(a)+int(b))&lt;/pre&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/dad6d9a1e2b0cc173c28405620cfc67c.gif&quot;/&gt;&lt;/p&gt;&lt;h2 style=&quot; margin: 8px 0px 16px;  font-weight: 600;  font-size: 22px; color: rgb(79, 79, 79); line-height: 30px;    &quot;&gt;字符串示例&lt;/h2&gt;&lt;pre class=&quot;brush:php;toolbar:false&quot;&gt;?php

$name&amp;nbsp;=&amp;nbsp;&amp;#39;订单5210804229002567电子发票.pdf&amp;#39;;
$cmd&amp;nbsp;=&amp;nbsp;shell_exec(&amp;quot;python&amp;nbsp;sum.py&amp;nbsp;$name&amp;quot;);

echo&amp;nbsp;$cmd;&lt;/pre&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;import&amp;nbsp;sys

#&amp;nbsp;以下两行解决中文乱码问题
import&amp;nbsp;codecs
sys.stdout&amp;nbsp;=&amp;nbsp;codecs.getwriter(&amp;#39;utf-8&amp;#39;)(sys.stdout.detach())

a&amp;nbsp;=&amp;nbsp;sys.argv[1]&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;接收位置参数
print(a)&lt;/pre&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/12/1413124b6819eed8fd55a3eceb26b4eb.png&quot;/&gt;&lt;/p&gt;&lt;h1 style=&quot; margin-top: 8px; margin-bottom: 16px;  font-weight: 600;  font-size: 24px; color: rgb(79, 79, 79); line-height: 32px;    &quot;&gt;&lt;a id=&quot;PHP_shell_execexecpassthrusystem_59&quot; style=&quot;outline: none; margin: 0px;  font-weight: normal; cursor: pointer; color: rgb(78, 161, 219); &quot;&gt;&lt;/a&gt;PHP （shell_exec()、exec()、passthru()、system()）的区别&lt;/h1&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;PHP：除了使用 shell_exec()，还可以使用 exec()、passthru() 和 system() 函数调用系统命令，&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;它们四者的区别如下：&lt;/p&gt;&lt;h2 style=&quot; margin: 8px 0px 16px;  font-weight: 600;  font-size: 22px; color: rgb(79, 79, 79); line-height: 30px;    &quot;&gt;shell_exec()&lt;/h2&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;通过 shell 环境执行命令，并且将完整的输出以字符串的方式返回。&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;也就是说, PHP先运行一个 shell 环境, 然后让 shell 进程运行你的命令, 并且把所有输出以字符串形式返回, 如果程序执行有错误或者程序没有任何输出, 则返回 null。&lt;/p&gt;&lt;h2 style=&quot; margin: 8px 0px 16px;  font-weight: 600;  font-size: 22px; color: rgb(79, 79, 79); line-height: 30px;    &quot;&gt;exec()&lt;/h2&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;与 shell_exec() 不一样, exec 不会创建 shell 进程, 可以理解是 php 进程直接创建一个子进程, 运行指定的命令, 返回值只返回命令的最后一行, 所有的返回以参数形式返回。&lt;/p&gt;&lt;h2 style=&quot; margin: 8px 0px 16px;  font-weight: 600;  font-size: 22px; color: rgb(79, 79, 79); line-height: 30px;    &quot;&gt;passthru()&lt;/h2&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;与 exec() 类似, 唯一不同的是, 命令的所有输出返回内容都不再导入到 PHP 环境, 而是直接作为输出内容, 返回到浏览器的输出上, 等效是把所有返回内容直接 echo 输出。&lt;/p&gt;&lt;h2 style=&quot; margin: 8px 0px 16px;  font-weight: 600;  font-size: 22px; color: rgb(79, 79, 79); line-height: 30px;    &quot;&gt;system()&lt;/h2&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;这个方法和 passthru() 类似, 但是 system() 方法会在程序的每行输出的时候执行一次缓存输出动作, 可以理解为, 只要外部程序输出一行, php 就会马上把内容推送到浏览器, 无论这个内容是否足够大。&lt;/p&gt;&lt;p style=&quot; margin-bottom: 16px;  font-size: 16px; color: rgb(77, 77, 77); line-height: 26px;      &quot;&gt;php通常为了输出效率, 都会有一个输出缓存, 会等到输出内容足够大之后, 再一次输出返回. system() 方法则强制输出内容立刻推送, 即使输出的内容只有一个字母. 如果客户端具有实时打印服务器的返回 http 内容流的能力, 就可以看到 system() 的实时推送效果。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 13 Dec 2022 13:41:02 +0800</pubDate></item><item><title>python 通过函数名判断函数是否存在及调用</title><link>//www.nswlp.cn/post/350.html</link><description>&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;1. 根据“__call__”属性判断&lt;/p&gt;&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;有时候用python就有这么一种感悟，各种钩子函数就是通过内置的“__”属性实现，python学得好不好，就是对“__”属性理解得透彻不透彻。&lt;/p&gt;&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;python函数在调用时，一定会首先调用其相关“__call__”函数（没有空格），请参见python总结(四)：类装饰器与方法的动态添加中的用法。&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;add&amp;nbsp;=&amp;nbsp;lambda&amp;nbsp;a,&amp;nbsp;b:&amp;nbsp;a&amp;nbsp;+&amp;nbsp;b
#&amp;nbsp;&amp;nbsp;&amp;nbsp;判断成功
if(hasattr(add,&amp;nbsp;&amp;#39;__call__&amp;#39;)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print&amp;nbsp;add(1,2)&lt;/pre&gt;&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;2. 利用callable判断&lt;/p&gt;&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;这是一个据传快要废弃的方法，但是在Python 2中依旧很好用，如下：&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;判断成功
if(callable(add)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print&amp;nbsp;add(2,&amp;nbsp;2)&lt;/pre&gt;&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;3. 利用isfunction进行判断&lt;/p&gt;&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;Python的inspect模块包含了大量的与反射、元数据相关的工具函数，isfunction就是其中一种，使用方法如下：&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;from&amp;nbsp;inspect&amp;nbsp;import&amp;nbsp;isfunction
#&amp;nbsp;&amp;nbsp;&amp;nbsp;判断成功
if(isfunction(add)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print&amp;nbsp;add(5,&amp;nbsp;5)&lt;/pre&gt;&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;-------------------------------我是分割线----------------------------&lt;/p&gt;&lt;p style=&quot;outline: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; white-space: normal;  line-height: 24px !important;&quot;&gt;现在有多个命名类似的函数,我重新组装函数名(字符串)要判断是否存在及其调用,要用到了python的&lt;span style=&quot;outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; color: rgb(243, 59, 69);&quot;&gt;&lt;span style=&quot;outline: 0px; font-weight: 700; overflow-wrap: break-word;&quot;&gt;eval&lt;/span&gt;&lt;/span&gt;函数&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;def&amp;nbsp;fun():
print(&amp;#39;hello&amp;#39;)
a&amp;nbsp;=&amp;nbsp;&amp;#39;fun&amp;#39;
#&amp;nbsp;判断函数是否存在
print(callable(eval(a),&amp;#39;__call__&amp;#39;))
&amp;gt;&amp;nbsp;True
#&amp;nbsp;调用函数
eval(a)()
&amp;gt;&amp;nbsp;hello&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(77, 77, 77); font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; &quot;&gt;应用示例:&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:python;toolbar:false&quot;&gt;def&amp;nbsp;fun1(msg):
print(1,msg.get(&amp;#39;info&amp;#39;))
def&amp;nbsp;fun2(msg):
print(2,msg.get(&amp;#39;info&amp;#39;))
def&amp;nbsp;fun3(msg):
print(3,msg.get(&amp;#39;info&amp;#39;))
msg&amp;nbsp;=&amp;nbsp;{&amp;#39;type&amp;#39;:1,&amp;#39;info&amp;#39;:&amp;#39;111&amp;#39;}
fun_name&amp;nbsp;=&amp;nbsp;&amp;#39;fun&amp;#39;+str(msg.get(&amp;#39;type&amp;#39;))
if&amp;nbsp;callable(eval(fun_name),&amp;#39;__call__&amp;#39;):
eval(fun_name)(msg)
else:
raise&amp;nbsp;Exception(&amp;#39;not&amp;nbsp;found&amp;nbsp;function&amp;#39;)&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(77, 77, 77); font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; &quot;&gt;这样就可以根据消息类型调用不同的处理函数&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(77, 77, 77); font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; &quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;</description><pubDate>Tue, 13 Dec 2022 13:18:49 +0800</pubDate></item><item><title>45个实用的前端开发工具汇总</title><link>//www.nswlp.cn/post/348.html</link><description>&lt;p&gt;&amp;#39;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;作为开发者的我们，学会使用一些适合自己的开发工具，可以让我们的生活更加自由轻松，因此，今天我跟大家分享45款实用的工具，主要是针对开发与设计人员的，希望这些工具能够帮助到你。&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;现在，我们就开始今天的内容。&lt;/span&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;font-size: 16px; &quot;&gt;&lt;span style=&quot;color: rgb(26, 177, 204); &quot;&gt;1、Check&lt;/span&gt;&lt;/strong&gt;&lt;strong style=&quot;font-size: 16px; &quot;&gt;&lt;span style=&quot;color: rgb(26, 177, 204); &quot;&gt;list Design&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://www.checklist.design&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/30c02f1e9511e82bab172341905dadae.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;在设计按钮、卡片、表格等网站元素时，通过网站上提供信息和基本元素来综合网站设计知识的地方。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;2、Web Gradients&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://webgradients.com/&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/caf6d825c4555ab3a3253634389c8221.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;在这里我们可以实现网站漂亮的渐变背景颜色的设计与合成。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;3、Webframe&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://webframe.xyz&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/f7dcd78df350af9ccb5ae42fdaba069d.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;收集精美的 Web 应用程序设计并每周更新。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;4、spline&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://spline.design&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/f41a758efbeaab8e3f0f831e339fec47.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;该应用程序可帮助我们为网站创建 3D 效果。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;5、type&amp;nbsp;anything&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://app.typeanything.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/528dab59e895e37a99faac85eed3eb68.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;允许我们为网站设计排版Web 应用程序，例如字体选择、字体粗细、字间距……&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;6、Laws Of UX&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://lawsofux.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/de7d3446c01bc2776244314442a7c01a.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;设计师在构建网站用户界面时的最佳实践集合。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;7、animista&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://animista.net&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/1dd919b002fb1a405799f5df38019cfe.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;帮助我们练习用于网站开发的 CSS 动画效果的 Web 应用程序。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;8、screenlane&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://screenlane.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/8754a7ec669cc92ccd45ad5498b1bfff.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;专门为网站综合UI设计。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;9、Froala 设计块&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://froala.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/a69bc398128e5e8d3dbfa16cdd6da813.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;网站设计合成，上面有超过 170 个 UI 响应式设计。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;10、&amp;nbsp;3Dicons&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://3dicons.co&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/a4528dced54f8531aaa7f95992a95804.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;用于网站设计和开发的免费 3D 图标集合。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;11、Collectui&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://collectui.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/4aa4a621855c0533091851fde336c0e9.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;UI设计摘要并每天更新。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;12、humaaans&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://www.humaaans.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/458a1dcc1cc9ff5cafe2158ae1811025.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;为设计师收集人物插图。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;13、设计原则&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://principles.design&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/31bce7f582097b8c2b66f7ceb2621d0e.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;一个致力于提供设计原则和方法的开源集合。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;14、learn-anything&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://learn-anything.xyz&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/fad56267f231038b6ad872b3d51ed0e2.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;当我们想学习一些东西时，这里提供详细的路线。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;15、简历设计&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://standardresume.co&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/e2c0d832ffdb4276787605cd2bcdb206.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;一个 Web 应用程序，可帮助设计人员、开发人员创建精美的简历/简历。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;16、pictogon&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://pictogon.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/3821cb24003b6d73d72251aef2d73e3c.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;帮助您为您的网站创建交互式图像。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;17、&amp;nbsp;ui play book&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://uiplaybook.dev&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/7c6483a0c3706c61ec1533c02efaab38.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;用于构建 UI 组件的文档。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;18、ui patterns&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：http://uipatterns.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/0dc8d1f09449d1ee1b6d6eeeceda688c.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;它可以帮助我们发现设计模式以及如何解决网站设计过程中的常见问题。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;19、&amp;nbsp;网站博物馆&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://www.kapwing.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/3e96ab9657b7c32c803f7d66936cef81.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;是综合各个发展阶段著名网站设计的地方。在我看来，它将帮助我们更好地了解如何设计和开发网站界面。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;20、用户体验挑战&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://uxtools.co&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/4bb68255e7b969ae4266cd7ada5ab08f.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;网站用户体验设计练习集。我喜欢它的是，在每个挑战中，都会有特定的教程文章。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;21、用户体验项目清单&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://uxchecklist.github.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/ff18ea2c584dd8faf6ba343dcf2d086a.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;一个帮助我们检查 UX 功能是否符合设计标准的地方。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;22、登陆页面清单&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://landingpage.fyi&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/1891e105ee71e1020a87be5f69cf8531.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;综合了 100 多种登陆页面工具，例如选择域名、登陆页面设计软件、标志制作工具……&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;23、 Ray&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://ray.so&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/411fa45880bfb9033b28f441fbcb6690.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;为我们的代码创建漂亮图像的在线软件。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;24、像素测量&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://getpixelsnap.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/972c933b4c5fd14596c4bbba993420fa.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;帮助我们精度测量网站中元素之间的距离。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;25、Patternpad&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://patternpad.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/3c30c4090fd14b1350026dfbca5e4d10.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;为网站创建漂亮背景图案的Web 应用程序。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;26、 Klart&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://klart.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/82d829eb6b9a0026ead28a587e519fa4.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;该网站的一组漂亮的调色板。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;27、 Drawkit&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://drawkit.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/5f996f120a0a5cb366edfe78a98e861d.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;为 Web 项目提供免费的插图和图标资源。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;28、 Get Waves&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://getwaves.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/648754b957ced9ffc654c55913f79123.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;为网站创建波浪动画效果的工具。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;29、用户体验流&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://products.ls.graphics&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/e1e2991fdfa64f340a8ad360573034b1.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;它可以帮助我们在 Sketch、Figma 和 Adobe XD 中创建漂亮的网站布局变得容易。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;30、Code to go&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://codetogo.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/bc5cba75a2a080e17c3dee9c423699ce.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;合成片段，帮助我们解决网站开发中的常见问题。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;31、Blobmaker&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://www.blobmaker.app&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/9388193a445f4f2ac28964f653bd68a0.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;帮助我们轻松地为网页元素创建 blob 效果。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;32、网页代码工具&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://webcode.tools&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/9beb3945e9f49b37323eece1c5b401ec.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;为 HTML、CSS、元标记、JSON... 合成生成器工具&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;33、Responsively&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://responsively.app&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/1160cb00a25b02d639c5492cab9f9026.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;该应用程序可帮助我们在许多不同的设备屏幕上快速测试网站项目。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;34、&amp;nbsp;前端清单&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://frontendchecklist.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/5c87d956c5ce5d37e464df516e0754b9.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;可以帮助我们在构建前端项目时检查要点的工具。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;35、Sketch2Code&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://sketch2code.azurewebsites.net&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/56f81ab04a5164a815e7322d650b048d.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;使用 AI 将手绘设计转换为 HTML 的工具。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;36、Bootstrap Magic 4.0&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://sketch2code.azurewebsites.net&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/ea643def559459676e1ba1d7f1f98eac.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;它可以帮助我们在使用 Bootstrap4 设计网站时，让主题设计变得快速和容易。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;37、&amp;nbsp;Glassmorphism CSS 生成器&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://ui.glass/generator/&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/58aff72bc97dc37de1fc41dec40e870e.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;帮助我们为网站设计创建玻璃效果。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;38、UnusedCSS&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://unused-css.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/b7d10461c9e1a4b20712fb680cf0db35.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;为 Web 项目删除不必要的 CSS 属性。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;39、Magic Pattern&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://www.magicpattern.design&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/df1459a9d2b1ffecf0633f3598a2181c.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;网站设计工具的集合。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;40、Cool Backgrounds&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://coolbackgrounds.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/dbe6893262d5715a4b13de191d4eff87.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;帮助我们为网站开发创建精美的背景图像效果。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;41、Loremipsum&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://loremipsum.io&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/fece6844a049a1d314c201524b150927.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;帮助我们在网站开发过程中快速创建内容。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;42、谷歌字体&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://fonts.google.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/2e3b96ec04da0cc23f7dcf47f5c66efa.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;它是网站免费字体的集合。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;43、Wicked Backgrounds&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://wickedbackgrounds.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/c210c8b73f065b899585ccf68d8deb40.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;44、&amp;nbsp;自定义形状分隔线&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://www.shapedivider.app/&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/9f45e1c8788df8a01f872c500fcc43b8.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;帮助我们为网站项目创建漂亮的形状。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;45、UI Design Daily&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;地址：https://www.uidesigndaily.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/1bc7d71eacf5b632da1209faa63038d7.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;font-size: 16px; &quot;&gt;它是一个为网页设计合成 UI 设计的地方。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&amp;#39;&lt;/p&gt;</description><pubDate>Wed, 23 Feb 2022 14:28:23 +0800</pubDate></item><item><title>26个为开发项目准备的免费优质矢量素材网站</title><link>//www.nswlp.cn/post/347.html</link><description>&lt;p&gt;&amp;#39;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;为了避免重复劳动力，我把一些自己收藏使用的插图素材网站做了一个打包，希望这些资源网站对大家有所帮助。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;现在，我们就开始今天的内容。&lt;/span&gt;&lt;br style=&quot;margin: 0px;   max-width: 100%; &quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;01、Flaticon design&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：http://flat-icon-design.com&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51); font-size: 17px; letter-spacing: 0.544px; text-align: center;&quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/a19f4632ddf311e711cb7976e7bbe016.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51); font-size: 17px; letter-spacing: 0.544px; text-align: center;&quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/9bd775deb080d26175fa5d54cccf6383.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个是一个日语网站，网站对各种矢量素材做了分类，都是比较主流的设计风格，对于做设计的朋友，这个网站，也是比较友好的，网站上还提供了多种下载格式，其中包括AI、EPS、JPEG、PNG、SVG。&lt;/span&gt;&lt;br style=&quot;margin: 0px;   max-width: 100%; &quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;02、unDraw&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://undraw.co/illustrations&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/435380bd95c820963fea11306ed0a095.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上有很多的插图，并且颜色可以自己定义，非常好用，网站上提供了SVG和PNG格式进行下载。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;03、IRA Design&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://iradesign.io/illustrations&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/b1f881554a815da1db1ca27604acd32b.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上提供了多种色彩混合模式，&lt;span style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;包括人物、物体、背景等素材，这些素材还可以&lt;/span&gt;自定义渐变色彩。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;04、Ouch&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://icons8.com/illustrations&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/0435f4850ca9160c2473a07b07c4f4b5.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上有很多可以免费下载的 PNG 和 SVG 插图。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;05、DrawKit&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://www.drawkit.io/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/84d3c9e8d7c54178d07891edbdcb48bc.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上有免费的也有付费插画资源，我们可以根据自己需要进行下载获取即可，网站对插画图进行了分类，个人觉得非常方便。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;06、Humaaans&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://www.humaaans.com/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/0f634dda46ef05651a567b43ab44cd22.gif&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/d1a2c908f323285ae0f83ed9b45265e6.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上的插画，可以随便混搭，我们可以在线改变插画人物的发型、上衣、裤子等，修改完后，我们还可以将自己设计的插画人物进行下载使用。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;07、illu-station&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://themeisle.com/illustrations/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/12baf5a56efbc55be57cc61d706d882e.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上有很多高质量的插图，与 unDraw 类似，我们还可以自行设置插画颜色，然后再进行下载。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;08、blush.design&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://blush.design/zh-CN&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/ff7c54480153373b3c3c3abab6eb0d01.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上有很多风格的插画，我们可以进行多种尝试，网站上提供了 PNG 、 SVG格式供我们下载。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;09、Glaze&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://www.glazestock.com/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/8f9904554a4dda6084bc31bc2a47568c.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上的插图给我们进行了分类，有人物、地点、团队合作、动物、正念、商业、健康、技术等，免费插图我们可以通过PNG 格式进行下载。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;10、ManyPixels&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://www.manypixels.co/gallery&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/538a8ad1766e78fe870c91d2470b64d6.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上有各种插图类型，例如轮廓、单色、等距、扁平线和双色，我们可以在线设置插图的主要颜色，以适应我们的特定设计。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;11、Open Doodles&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://www.opendoodles.com/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/d99d59819ee965878ef635d1cda63ebf.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;br style=&quot;margin: 0px;   max-width: 100%; &quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上的插图，特别有意思，它们都是基于手绘的独特矢量插图。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;12、Storyset&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://storyset.com/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/3c99589f8e4fc862b6a947ef24f63fc5.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上的在线编辑器功能，我觉得非常好用，我们可以在线根据自己需要，然后编辑好再下载，很方便。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;13、Skribbl&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://weareskribbl.com/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/d0a62fa6878bf620a247bec471b15b4a.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上的插画都是黑白形式的，喜欢这个风格的插画，可以上去看看。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;14、OpenPeeps&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://www.openpeeps.com/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51); font-size: 17px; letter-spacing: 0.544px; text-align: center;&quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/0dd095c5496d150767dd0e897fc96c6f.gif&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51); font-size: 17px; letter-spacing: 0.544px; text-align: center;&quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/2da5177367998c8dea2f2f5afdf0ea14.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这是一个手绘人物插图，在这个网站上，我们可以根据自己需要创建人物，也可以直接下载获取网站上的素材。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;15、Illustratious&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://illustratious.com&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/d60d8f7ed7f042739952ea3ce1cca8b6.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个上面有很多免费的彩色插图和动画文件。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;16、LukaszAdam&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://lukaszadam.com/illustrations&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/5c4815e1b9498a349a73bdb062f3b1ee.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上面的有很多插画家、设计师创建的插图，可以免费用于商业和个人用途。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;17、Absurd.Design&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://absurd.design/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/69f3d1ca7b0d7b1a9c620f1edbc98771.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;第一次打开这个插画网站的时候，我就被上面有趣的插画吸引住了，如果我们做点不一样的插画，那这个网站不要错过。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;18、Peecheey&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;网址：http://www.peecheey.com&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/0602a787bcc64235a524517b5cfb2ea9.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上的矢量素材是完全免费的，主要有插画、信息图表、图标等。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;19、Freepik&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://www.freepik.com/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/15fd73a6c8d3892cfdec2af04b3d094f.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上的素材，有免费也有付费，建议直接下载免费的就可以了，这个上面的素材，质量都不错，既可以下载直接使用，也可以作为设计灵感库，我个人还是非常喜欢的。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;20、bg-patterns&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：http://bg-patterns.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/cde3e93fc81fe978ad2755f2acf5674c.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个是一个矢量背景素材网站，我们可以自定义素材的彩色、形状、尺寸等，这也是我个人非常喜欢的一个网站。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;21、&lt;/span&gt;&lt;/strong&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;Vecteezy&lt;/strong&gt;&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 8px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：http://www.vecteezy.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/fe18b359cf5853ed5491350749963a8c.png&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这是一个免费矢量图的索引站点，收集了相当多的图片素材，并且天天有更新，在这还能看到其他设计师共享的一些矢量图形，我们可以随时随地的去下载免费的素材&lt;/span&gt;。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; &quot;&gt;22、DryIcons&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://dryicons.com/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/9518f97ee43f897f7ac839f33a17a430.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(0, 0, 0);  font-size: 16px; &quot;&gt;这个网站上提供了大量免费矢量素材、图标、icon、背景等素材资源供我们下载&lt;/span&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(0, 0, 0);  font-size: 16px; &quot;&gt;，有免费也付费的，个人觉得，也可以上去看看。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; &quot;&gt;23、Vector Portal&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://vectorportal.com/&lt;br style=&quot;margin: 0px;   max-width: 100%; &quot;/&gt;&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/efd0aff3450fb2f15156cbaa211a1fe6.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(0, 0, 0);  font-size: 16px; &quot;&gt;这个网站上提供了非常多的&lt;/span&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(0, 0, 0);  font-size: 16px; &quot;&gt;矢量插图，我们可以在个人和商业项目中使用，网站上还做了分类，也有搜索功能，找素材非常方便。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;24、silhouetteAC&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：https://www.silhouette-ac.com/tw/&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/30267a15ab160d8ff34f303f2f14741f.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站的矢量素材，都是以剪影的方式呈现，非常有特色，我个人也比较喜欢，网站全部都能直接免费下载，并且也能进行商业使用，如果你喜欢这种剪影风格的矢量素材，我强烈推荐这个网站。&lt;/span&gt;&lt;br style=&quot;margin: 0px;   max-width: 100%; &quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;25、vectorish&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：http://vectorish.com&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/133f7dd19d86d6691981e5ef41f20316.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上有很多免费创意矢量图，有抽象图、图标、Illustrator、自然、logo 等，这些素材都是可以免费下载使用的。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;26、Shareicon&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;网址：http://www.shareicon.net&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/002059c490e37f46eb784c24e1764c27.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;这个网站上拥有超过 25 万 的icon 矢量图，120 多种分类，所有的素材都提供 PNG、SVG 格式下载，同时也包括多种尺寸，例如&lt;/span&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(0, 0, 0);  font-size: 16px; &quot;&gt;512*512、256*256、128*128、64*64、32*32、16*16等，&lt;/span&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(0, 0, 0);  font-size: 16px; &quot;&gt;这&lt;/span&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(0, 0, 0);  font-size: 16px; &quot;&gt;个网站跟阿里巴巴的矢量图标库有点像，很多做开发做设计的朋友都知道阿里巴巴矢量图标库，里面也有非常多的矢量图标，它&lt;/span&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(0, 0, 0);  font-size: 16px; &quot;&gt;也是一个非常好用的素材库网站。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;总结&lt;/span&gt;&lt;/strong&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 8px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%;  font-size: 16px; color: rgb(0, 0, 0); &quot;&gt;今天内容就先到这里了，如果还有什么问题，请在留言区给我留言，如果你觉得我今天的非常的资源不错，请不要忘记点赞我，关注我，同时，如果觉得非常有帮助的话，也请你分享给你身边做设计做开发或者需要这个资源的朋友。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&amp;#39;&lt;/p&gt;</description><pubDate>Wed, 23 Feb 2022 14:14:57 +0800</pubDate></item><item><title>JavaScript语法 ES6、ES7、ES8、ES9、ES10、ES11、ES12新特性汇总</title><link>//www.nswlp.cn/post/346.html</link><description>&lt;h3 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;新特性ES6（2015）&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;1、类（类）&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;class&amp;nbsp;Man&amp;nbsp;{
&amp;nbsp;&amp;nbsp;constructor(name)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.name&amp;nbsp;=&amp;nbsp;&amp;nbsp;JavaScript语法;
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;console()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(this.name);
&amp;nbsp;&amp;nbsp;}
}
const&amp;nbsp;man&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Man(&amp;nbsp;JavaScript语法);
man.console();&amp;nbsp;//&amp;nbsp;&amp;nbsp;JavaScript语法&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;2、智能（ES模块）&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;模块&amp;nbsp;A&amp;nbsp;导出一个方法
export&amp;nbsp;const&amp;nbsp;sub&amp;nbsp;=&amp;nbsp;(a,&amp;nbsp;b)&amp;nbsp;=&amp;nbsp;a&amp;nbsp;+&amp;nbsp;b;
//&amp;nbsp;模块&amp;nbsp;B&amp;nbsp;导入使用
import&amp;nbsp;{&amp;nbsp;sub&amp;nbsp;}&amp;nbsp;from&amp;nbsp;./A;
console.log(sub(1,&amp;nbsp;2));&amp;nbsp;//&amp;nbsp;3&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;3、箭头（箭头）函数&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;func&amp;nbsp;=&amp;nbsp;(a,&amp;nbsp;b)&amp;nbsp;=&amp;nbsp;a&amp;nbsp;+&amp;nbsp;b;
func(1,&amp;nbsp;2);&amp;nbsp;//&amp;nbsp;3&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;4、函数参数默认值&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;function&amp;nbsp;foo(age&amp;nbsp;=&amp;nbsp;25,){&amp;nbsp;//&amp;nbsp;...}&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;5、&amp;nbsp;模板字符串&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;name&amp;nbsp;=&amp;nbsp;&amp;nbsp;JavaScript语法;
const&amp;nbsp;str&amp;nbsp;=&amp;nbsp;`Your&amp;nbsp;name&amp;nbsp;is&amp;nbsp;${name}`;&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;6、解构架构&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;let&amp;nbsp;a&amp;nbsp;=&amp;nbsp;1,&amp;nbsp;b=&amp;nbsp;2;
[a,&amp;nbsp;b]&amp;nbsp;=&amp;nbsp;[b,&amp;nbsp;a];&amp;nbsp;//&amp;nbsp;a&amp;nbsp;2&amp;nbsp;&amp;nbsp;b&amp;nbsp;1&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;7、延展符&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;let&amp;nbsp;a&amp;nbsp;=&amp;nbsp;[...hello&amp;nbsp;world];&amp;nbsp;//&amp;nbsp;[h,&amp;nbsp;e,&amp;nbsp;l,&amp;nbsp;l,&amp;nbsp;o,&amp;nbsp;&amp;nbsp;,&amp;nbsp;w,&amp;nbsp;o,&amp;nbsp;r,&amp;nbsp;l,&amp;nbsp;d]&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;8、对象属性简写&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;name=&amp;nbsp;fly63前端,
const&amp;nbsp;obj&amp;nbsp;=&amp;nbsp;{&amp;nbsp;name&amp;nbsp;};&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;9、承诺&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;Promise.resolve().then(()&amp;nbsp;=&amp;nbsp;{&amp;nbsp;console.log(2);&amp;nbsp;});
console.log(1);
//&amp;nbsp;先打印&amp;nbsp;1&amp;nbsp;，再打印&amp;nbsp;2&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;10、让和常量&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;let&amp;nbsp;name&amp;nbsp;=&amp;nbsp;&amp;nbsp;JavaScript语法；
const&amp;nbsp;arr&amp;nbsp;=&amp;nbsp;[];&lt;/pre&gt;&lt;h3 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;ES7（2016）&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;1、&amp;nbsp;Array.prototype.includes()&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;[1].includes(1);&amp;nbsp;//&amp;nbsp;true&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;2、指数操作符&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;2**10;&amp;nbsp;//&amp;nbsp;1024&lt;/pre&gt;&lt;h3 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;ES8（2017）&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;1、异步/等待&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;终极终极解决方案&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;async&amp;nbsp;getData(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;res&amp;nbsp;=&amp;nbsp;await&amp;nbsp;api.getTableData();&amp;nbsp;//&amp;nbsp;await&amp;nbsp;异步任务
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;do&amp;nbsp;something&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;2、Object.values()&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;Object.values({a:&amp;nbsp;1,&amp;nbsp;b:&amp;nbsp;2,&amp;nbsp;c:&amp;nbsp;3});&amp;nbsp;//&amp;nbsp;[1,&amp;nbsp;2,&amp;nbsp;3]&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;3、&amp;nbsp;Object.entries()&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;Object.entries({a:&amp;nbsp;1,&amp;nbsp;b:&amp;nbsp;2,&amp;nbsp;c:&amp;nbsp;3});&amp;nbsp;//&amp;nbsp;[[a,&amp;nbsp;1],&amp;nbsp;[b,&amp;nbsp;2],&amp;nbsp;[c,&amp;nbsp;3]]&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;4、字符串填充&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;padStart
hello.padStart(10);&amp;nbsp;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hello
//&amp;nbsp;padEnd
hello.padEnd(10)&amp;nbsp;hello&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;5、函数参数列表允许结尾&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;规定也一样，职能规定与规则和结尾的逗号，保持一致。&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;6、Object.getOwnPropertyDescriptors()&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-bottom: 0px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;如果对象的所有自身属性获取一个空，则如果没有返回对象。&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;7、SharedArrayBuffer对象&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;SharedArray 对象使用表示一个通用的长度的密封缓冲区，密封，&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;/**
&amp;nbsp;*&amp;nbsp;
&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;{*}&amp;nbsp;length&amp;nbsp;所创建的数组缓冲区的大小，以字节(byte)为单位。
&amp;nbsp;*&amp;nbsp;@returns&amp;nbsp;{SharedArrayBuffer}&amp;nbsp;一个大小指定的新&amp;nbsp;SharedArrayBuffer&amp;nbsp;对象。其内容被初始化为&amp;nbsp;0。
&amp;nbsp;*/
new&amp;nbsp;SharedArrayBuffer(10)&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;8、原子对象&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-bottom: 0px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;Atomics 对象提供了一组静态方法，用于对 SharedArrayBuffer 对象进行原子操作。&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;ES9（2018）&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;1、徒劳&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;await可以和for...的循环使用，以某种方式运行异步操作&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;async&amp;nbsp;function&amp;nbsp;process(array)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;for&amp;nbsp;await&amp;nbsp;(let&amp;nbsp;i&amp;nbsp;of&amp;nbsp;array)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;doSomething(i);
&amp;nbsp;&amp;nbsp;}
}&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;2、&amp;nbsp;Promise.finally()&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;Promise.resolve().then().catch(e&amp;nbsp;=&amp;nbsp;e).finally();&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;3、Rest/Spread 属性&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;values&amp;nbsp;=&amp;nbsp;[1,&amp;nbsp;2,&amp;nbsp;3,&amp;nbsp;5,&amp;nbsp;6];
console.log(&amp;nbsp;Math.max(...values)&amp;nbsp;);&amp;nbsp;//&amp;nbsp;6&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;4、正则导演组&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;reg&amp;nbsp;=&amp;nbsp;/(year[0-9]{4})-(month[0-9]{2})-(day[0-9]{2})/;
const&amp;nbsp;match&amp;nbsp;=&amp;nbsp;reg.exec(2021-02-23);&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;5、正则表达式相反声明&lt;/strong&gt;&lt;/h4&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;(=p)、(=p)&amp;nbsp;&amp;nbsp;p&amp;nbsp;前面(位置)、p&amp;nbsp;后面(位置)
(!p)、(!p)&amp;nbsp;除了&amp;nbsp;p&amp;nbsp;前面(位置)、除了&amp;nbsp;p&amp;nbsp;后面(位置)&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;6、正则表达式dotAll模式&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-bottom: 0px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;正则表达式中点。除匹配回车外的任何单字符，标记改变这种行为，允许行终止符的出现。&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;/hello.world/.test(hello\nworld);&amp;nbsp;//&amp;nbsp;false&lt;/pre&gt;&lt;h3 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;ES10（2019）&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;1、Array.flat()和Array.flatMap()&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;平坦的（）&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;[1,&amp;nbsp;2,&amp;nbsp;[3,&amp;nbsp;4]].flat(Infinity);&amp;nbsp;//&amp;nbsp;[1,&amp;nbsp;2,&amp;nbsp;3,&amp;nbsp;4]&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51);  font-size: 16px; letter-spacing: 0.544px; &quot;&gt;平面图（）&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;[1,&amp;nbsp;2,&amp;nbsp;3,&amp;nbsp;4].flatMap(a&amp;nbsp;=&amp;nbsp;[a**2]);&amp;nbsp;//&amp;nbsp;[1,&amp;nbsp;4,&amp;nbsp;9,&amp;nbsp;16]&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51);  font-size: 16px; letter-spacing: 0.544px; &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;2、String.trimStart()和String.trimEnd()&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;去除字符串首尾字符&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;3、String.prototype.matchAll&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;matchAll（）为所有匹配的匹配对象返回一个重复器&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;raw_arr&amp;nbsp;=&amp;nbsp;test1&amp;nbsp;&amp;nbsp;test2&amp;nbsp;&amp;nbsp;test3.matchAll((/t(e)(st(\d))/g));
const&amp;nbsp;arr&amp;nbsp;=&amp;nbsp;[...raw_arr];&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;4、Symbol.prototype.description&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;只读属性，返回 Symbol 对象的任选描述的字符串。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;Symbol(description).description;&amp;nbsp;//&amp;nbsp;description&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;5、&amp;nbsp;Object.fromEntries()&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;返回一个给定对象本人可枚举属性值的关键值。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;//&amp;nbsp;通过&amp;nbsp;Object.fromEntries，&amp;nbsp;可以将&amp;nbsp;Map&amp;nbsp;转化为&amp;nbsp;Object:
const&amp;nbsp;map&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Map([&amp;nbsp;[foo,&amp;nbsp;bar],&amp;nbsp;[baz,&amp;nbsp;42]&amp;nbsp;]);
console.log(Object.fromEntries(map));&amp;nbsp;//&amp;nbsp;{&amp;nbsp;foo:&amp;nbsp;bar,&amp;nbsp;baz:&amp;nbsp;42&amp;nbsp;}&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;6、任选捕获&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;在 ES10 之前，我们是这样异常的监护人：&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;try&amp;nbsp;{//&amp;nbsp;tryCode
}&amp;nbsp;catch&amp;nbsp;(err)&amp;nbsp;{//&amp;nbsp;catchCode
}&lt;/pre&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;这里的err是必须的参数，在ES10可以省略这个参数。&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;ES11（2020）&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;1、空值合并操作符（空值处理）&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;表达式在的左边求价值，未定义或返回其性质。&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;let&amp;nbsp;user&amp;nbsp;=&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;u1:&amp;nbsp;0,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;u2:&amp;nbsp;false,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;u3:&amp;nbsp;null,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;u4:&amp;nbsp;undefined
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;u5:&amp;nbsp;,
}
let&amp;nbsp;u2&amp;nbsp;=&amp;nbsp;user.u2&amp;nbsp;&amp;nbsp;用户2&amp;nbsp;&amp;nbsp;//&amp;nbsp;false
let&amp;nbsp;u3&amp;nbsp;=&amp;nbsp;user.u3&amp;nbsp;&amp;nbsp;用户3&amp;nbsp;&amp;nbsp;//&amp;nbsp;用户3
let&amp;nbsp;u4&amp;nbsp;=&amp;nbsp;user.u4&amp;nbsp;&amp;nbsp;用户4&amp;nbsp;&amp;nbsp;//&amp;nbsp;用户4
let&amp;nbsp;u5&amp;nbsp;=&amp;nbsp;user.u5&amp;nbsp;&amp;nbsp;用户5&amp;nbsp;&amp;nbsp;//&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;2、可选链（任选链）&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;用户检测宝宝的孩子&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;let&amp;nbsp;user&amp;nbsp;=&amp;nbsp;{}
let&amp;nbsp;u1&amp;nbsp;=&amp;nbsp;user.childer.name&amp;nbsp;//&amp;nbsp;TypeError:&amp;nbsp;Cannot&amp;nbsp;read&amp;nbsp;property&amp;nbsp;name&amp;nbsp;of&amp;nbsp;undefined
let&amp;nbsp;u1&amp;nbsp;=&amp;nbsp;user.childer.name&amp;nbsp;//&amp;nbsp;undefined&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;3、Promise.allSettled&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;返回在所有给定的承诺中，已被拒绝或被拒绝后的亲，并以一个对象的承诺，每个对象表示。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;promise1&amp;nbsp;=&amp;nbsp;Promise.resolve(3);
const&amp;nbsp;promise2&amp;nbsp;=&amp;nbsp;42;
const&amp;nbsp;promise3&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Promise((resolve,&amp;nbsp;reject)&amp;nbsp;=&amp;nbsp;reject(我是失败的Promise_1));
const&amp;nbsp;promise4&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Promise((resolve,&amp;nbsp;reject)&amp;nbsp;=&amp;nbsp;reject(我是失败的Promise_2));
const&amp;nbsp;promiseList&amp;nbsp;=&amp;nbsp;[promise1,promise2,promise3,&amp;nbsp;promise4]
Promise.allSettled(promiseList)
.then(values={
&amp;nbsp;&amp;nbsp;console.log(values)
});&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;4、进口（）&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;导入导入&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;5、新基本数据类型 BigInt&lt;/strong&gt;&lt;/h4&gt;&lt;p style=&quot;margin-bottom: 0px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;任意匹配的概率&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;6、globalThis&lt;/strong&gt;&lt;/h4&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 2.2em;  max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   width: 577.412px; line-height: 1.75em; &quot;&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;浏览器：window&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;工人：自己&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;margin-top: 15px; margin-bottom: 15px;   max-width: 100%; clear: both; min-height: 1em; line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; font-size: 16px; &quot;&gt;节点：全局&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;ES12（2021）&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;1、全部替换&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;返回一个全新的字符串，所有符合匹配规则的字符都将被替换掉&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;str&amp;nbsp;=&amp;nbsp;hello&amp;nbsp;world;
str.replaceAll(l,&amp;nbsp;);&amp;nbsp;//&amp;nbsp;heo&amp;nbsp;word&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;2、Promise.any&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;Promise.any() 接收到一个Promise 就可以没有拒绝，只要其中的一个promise 成功，就返回那个promise 。如果已经可以让对象中返回一个promise 成功（所有的promise 都失败/），失败的承诺。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;promise1&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Promise((resolve,&amp;nbsp;reject)&amp;nbsp;=&amp;nbsp;reject(我是失败的Promise_1));
const&amp;nbsp;promise2&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Promise((resolve,&amp;nbsp;reject)&amp;nbsp;=&amp;nbsp;reject(我是失败的Promise_2));
const&amp;nbsp;promiseList&amp;nbsp;=&amp;nbsp;[promise1,&amp;nbsp;promise2];
Promise.any(promiseList)
.then(values={
&amp;nbsp;&amp;nbsp;console.log(values);
})
.catch(e={
&amp;nbsp;&amp;nbsp;console.log(e);
});&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;3、弱引用&lt;/strong&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; &quot;&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;使用WeakRefs的Class类创建对对象的弱引用（对对象的弱引用是指当该对象应该被GC回收时不会阻止GC的回收行为）&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;4、逻辑和形式表现&lt;/strong&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; &quot;&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 0px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;之间的关系和表现，以及性能结合了之间的关系（和表现）&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;a&amp;nbsp;||=&amp;nbsp;b
//等价于
a&amp;nbsp;=&amp;nbsp;a&amp;nbsp;||&amp;nbsp;(a&amp;nbsp;=&amp;nbsp;b)

a&amp;nbsp;=&amp;nbsp;b
//等价于
a&amp;nbsp;=&amp;nbsp;a&amp;nbsp;&amp;nbsp;(a&amp;nbsp;=&amp;nbsp;b)

a&amp;nbsp;=&amp;nbsp;b
//等价于
a&amp;nbsp;=&amp;nbsp;a&amp;nbsp;&amp;nbsp;(a&amp;nbsp;=&amp;nbsp;b)&lt;/pre&gt;&lt;h4 style=&quot;margin: 15px 0px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;strong style=&quot;margin: 0px;   max-width: 100%; &quot;&gt;5、数字字符&lt;/strong&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; &quot;&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p style=&quot;margin-bottom: 0px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify;   &quot;&gt;&lt;span style=&quot;margin: 0px;   max-width: 100%; vertical-align: inherit; font-size: 16px; &quot;&gt;数字间隔性符，可以在数字之间创建可视化分隔符，通过_下划线来分割数字，使数字化可计算。&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:js;toolbar:false&quot;&gt;const&amp;nbsp;money&amp;nbsp;=&amp;nbsp;1_000_000_000;
//等价于
const&amp;nbsp;money&amp;nbsp;=&amp;nbsp;1000000000;

1_000_000_000&amp;nbsp;===&amp;nbsp;1000000000;&amp;nbsp;//&amp;nbsp;true&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px; text-align: justify; &quot;&gt;本文完~&lt;/span&gt;&lt;/p&gt;</description><pubDate>Wed, 23 Feb 2022 13:51:01 +0800</pubDate></item><item><title>17个免费看电影电视剧的网站，从此告别VIP，轻松看片追剧刷动漫，想看就看</title><link>//www.nswlp.cn/post/345.html</link><description>&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 2em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;当然，目前YouTube也有不少电影，但是，它广告比较多，除非，你付费观看，如果是这样的话，那爱奇艺，腾讯视频也一样可以，所以，这样一比较，YouTube就没有什么优势了。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 2em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;我今天分享的这些网站，电影电视剧资源都各有千秋，大家都可以根据自己需要来选择网站进行观看。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 2em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;有的网站，需要翻墙才可以观看，所以，需要大家先自行解决这个问题。&lt;br style=&quot;   max-width: 100%; &quot;/&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 2em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; text-align: justify; &quot;&gt;现在，我们就开始今天的内容吧。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;01、4K影视&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.4kvm.com/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/1cbe0d65dc6a3218c4b0aefdd0b271ac.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 2em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;4K影视网站，片源还是很丰富的，并且也不需要科学上网，打开网站即可播放，网站上有电影电视剧等影片，影片资源清晰度都很高。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;02、泥巴影院&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.nbyy.tv/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/2af78d21d7aade81750ee4a5219f51bb.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;泥巴影院提供了&lt;span style=&quot;   max-width: 100%; &quot;&gt;电影，电视剧，综艺，动漫，纪录片，体育等资源。&lt;/span&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;并且播放视频时也无广告，导航清晰，还提供了安卓版手机App, 可下载到手机上方便观看。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;03、片库&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.mypianku.net/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/8ad1ce866ee22d83f88fb1f4073c7878.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;片库网上有很多的电影电视剧资源，同时，动漫资源也很丰富，既可以在线观看，也可以选择下载观看，是一个非常好的免费看电影电视剧的网站，资源信息更新也比较快。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;04、唐人街影院&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.tangrenjie.tv/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/48b6a9d25dc4b20557cedfc4a2cd7628.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;唐人街影院，一听名字，就知道，它是一个专注于海外华人的电影电视剧网站。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;它除了电影，电视剧外，还有动漫，综艺等内容，信息内容更新也比较快。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;它除了支持电脑在线观看外，还支持安卓和苹果手机App安装观看。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;无需注册会员，即可免费观看，最重要的是没有广告弹出。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;05、捷华影视&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.jiehua.tv/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/26092c6f7f186ddcffb5a7b8423cbd4a.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;捷华影视，是一个多频道影视网站，里面包括电影，国产电视剧，台湾剧，欧美剧，日本剧，应有尽有。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;它支持简体繁体两种界面，它支持手机扫码观看。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;电视剧，电影更新速度快，很多都是最新的。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;06、欧乐影院&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.olevod.com/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/3b6acce07789accae863ad8be981316f.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;欧乐影院有&lt;span style=&quot;   max-width: 100%; &quot;&gt;电影，连续剧，综艺，动漫，午夜影院，VIP蓝光影院，&lt;span style=&quot;   max-width: 100%; &quot;&gt;支持高清视频， 支持在线搜索站内影视及综艺节目。&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;同时，它们还有自己专用的欧乐官方播放器，播放起来更加流畅。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;07、&amp;nbsp;优视频&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.uvod.tv/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/ae92784bf4523ec2b72fbb6bab938252.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;优视频网站，主要针对海外华人，无需注册即可看标清和高清视频，超清视频需要VIP付费。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;有iPhone版，安卓版，iPad版App应用。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;播放速度快，视频播放过程中无广告，节目更新比较快。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;08、独播库&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.duboku.tv/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/4c8058355508cdf24f331803224527c6.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;&lt;span style=&quot;   max-width: 100%; &quot;&gt;独播库网站上有很多电视剧，并且上面还有电视剧的打分，但是它上面没有任何电影的信息，如果你喜欢或者想观看电视剧的话，这个网站，你千万不要错过，里面有很多电视剧，&lt;/span&gt;主打大陆剧，英美剧，日韩剧，电影，动漫等。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;电影电视剧更新速度快，并且播放过程中无广告。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;09、胖子视频&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.pangzitv.com/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/4fef97edc7463d0444795c895b90c240.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;胖子视频网站，是一个比较综合的视频网站，里面有很多搞笑的视频，也有一些游戏视频。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;但是，网站的弹出广告较多，如果你不想被广告干扰，需要全屏播放，个人觉得这个网站体验一般。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;它上面也支持观看新闻联播，焦点访谈这样的新闻类节目，是为海外华人准备的内容。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;10、555电影&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网站：https://www.o8tv.com/&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/75d3a33e92a2ea42cca5701c92601559.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;555电影网，包括的内容有&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;电影，电视剧，纪录片，动漫，综艺等众多内容。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网站加载速度快，页面干净，最重要的是没有广告插入。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;11、瓜子TV&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://guazitv.tv&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/78628220fc5dc167af6c235b1b48e689.jpg&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;瓜子TV网站，可以看各种电影电视剧，真的超级方便，还是有很多好看的综艺节目，最主要的是免费，而且还没有广告，更新速度也非常快。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;12、剧嗨&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://www.juhi.cc&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/12e34080a15242d46e393c8b3babba74.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;剧嗨网，影片资源很丰富，而且网站界面也简洁清晰，影视资源更新也比较快，我个人比较喜欢这个网站的风格。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;13、奈飞中文电影站&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://yanetflix.com&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/8eb3ed375204d2a4b8344099a1d8149f.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;如果喜欢&lt;span style=&quot;   max-width: 100%; &quot;&gt;奈飞&lt;/span&gt;电影的话，这个网站你一定不要错过，里面有很多高质量的电影，电视剧，而且支持手机APP观看，播放速度也非常流畅，最重要的就是没有广告。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3 style=&quot;margin: 15px 16px;   font-size: 16px; max-width: 100%; color: rgb(51, 51, 51);  letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;14、Tubitv&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://tubitv.com&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/1d8074e45af57bf3498bd5cf1a4ae09a.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;Tubitv网站是一个美国的电影提供站，可以在很多国家进行访问，它的主要特点就是免费，没有广告。里面也有一些直播赛事，有兴趣的可以去看一下，我个人觉得觉得一般。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;15、HOHO TV&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：https://hoho.tv/&lt;br style=&quot;   max-width: 100%; &quot;/&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/cd789dbbb116fbf8848bd5e07c84bafb.png&quot;/&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 16px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;这个网站，有很多电影电视剧，不过它以韩剧质量高而著名，如果你喜欢看韩剧的话，这个网站不容错过。&lt;br style=&quot;   max-width: 100%; &quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 16px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网站也没有广告，可以自由观看。&lt;/span&gt;&lt;br style=&quot;   max-width: 100%; &quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;16、大师兄影视&lt;/strong&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;网址：&lt;/span&gt;https://dsxys.com&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/ebc7f57a55ab5d51e6edaa8906316089.png&quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;这个网站，我个人使用不多，因为我觉得打开速度有点慢，大家看我的截图就知道了，里面有的图片都没有加载出来，我不太喜欢等太久，所以，基本加载很慢的网站，我会直接关闭了。&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;但是，这个网站里面影片资源还是比较丰富的，也有很多最新出的电影电视剧，大家有兴趣的话，可以去看看。&lt;/span&gt;&lt;br style=&quot;   max-width: 100%; &quot;/&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;17、爱迪影视&lt;/strong&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;网址：https://aidi.tv&lt;/section&gt;&lt;section style=&quot;margin: 0px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   text-align: center; &quot;&gt;&lt;img src=&quot;//www.nswlp.cn/zb_users/upload/2022/02/7334fc8121de26702c3d5cdce9c3ff27.png&quot;/&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 15px 16px;   max-width: 100%; clear: both; min-height: 1em; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;这个网站不需要科学上网，就可以打开，&lt;/span&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;里面也有很多电影电视剧的影片资源。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 1.75em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; color: rgb(26, 177, 204); &quot;&gt;&lt;strong style=&quot;   max-width: 100%; &quot;&gt;总结&lt;/strong&gt;&lt;/span&gt;&lt;/section&gt;&lt;section style=&quot;margin: 15px 16px;   max-width: 100%; color: rgb(51, 51, 51);  font-size: 17px; letter-spacing: 0.544px;   line-height: 2em; &quot;&gt;&lt;span style=&quot;   max-width: 100%; font-size: 16px; &quot;&gt;以上内容就是我与你分享的17个免费看电影电视剧的网站，这些网站，有的是需要翻墙才可以观看的，有的可以直接打开，如果可以直接打开的网站，我也做了说明，其他没有做说明的网站，基本是需要梯子的，所以请自备梯子。&lt;/span&gt;&lt;/section&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 23 Feb 2022 13:12:43 +0800</pubDate></item></rss><!--18.84ms , 6 query , -681kb memory , 5 error-->