编辑
2026-01-10
前端
00

文件拖拽上传

js
------------------------------------------------------------------------------------------- <div class="up-file" ref="upFile"> <input type="file" ref="fileInput" accept=".xls,.xlsx,.csv" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; z-index: 100;" @change="handleFileChange"> <div class="box-svg"> <svg t="1767945363879" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1830" width="100%" height="100%"> <path d="M736.005 696.494H174.18c-17.673 0-32-14.327-32-32V255.582c0-17.673 14.327-32 32-32h157.213c7.96 0 15.635 2.967 21.525 8.321l47.547 43.222h335.54c17.673 0 32 14.327 32 32v357.369c0 17.673-14.327 32-32 32z m-529.825-64h497.825V339.125H388.094a32.002 32.002 0 0 1-21.525-8.321l-47.547-43.222H206.18v344.912z" :fill="sonTheme === 'dark' ? '#C3CAD3' : '#C3CAD3'" p-id="1831"></path> <path d="M853.18 821.092H317.509c-17.673 0-32-14.327-32-32s14.327-32 32-32H821.18V414.206c0-17.673 14.327-32 32-32s32 14.327 32 32v374.886c0 17.673-14.327 32-32 32z" :fill="sonTheme === 'dark' ? '#C3CAD3' : '#C3CAD3'" p-id="1832"></path> </svg> </div> <div class="text-tip"> 拖拽文件或点击上传 </div> </div>
编辑
2026-01-09
后端
00

复制文件夹

js
const fs = require('fs'); const path = require('path'); /** * 复制目录 * @param {string} originDir 源目录 * @param {string} remoteDir 目标目录 */
编辑
2026-01-07
后端
00

image.png

编辑
2026-01-02
前端
00

按规则找字符串 / 改字符串 / 校验字符串”

js
✅ 是否为数字 /^\d+$/ ✅ 是否为整数(可正可负) /^-?\d+$/ ✅ 是否为小数(含整数) /^-?\d+(\.\d+)?$/ ✅ 是否为空白(空格、tab) /^\s*$/
编辑
2025-12-26
后端
00

pino(nest-pino)(https://github.com/pinojs/pino/blob/HEAD/docs/web.md#nest) 和winston

js
import { NestFactory } from '@nestjs/core' import { Controller, Get, Module } from '@nestjs/common' import { LoggerModule, Logger } from 'nestjs-pino' @Controller() export class AppController { constructor(private readonly logger: Logger) {} 使用 @Get() getHello() { this.logger.log('something') return `Hello world` } } @Module({ controllers: [AppController], imports: [LoggerModule.forRoot()] // 导入 }) class MyModule {} async function bootstrap() { const app = await NestFactory.create(MyModule) await app.listen(3000) } bootstrap()