
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
一个功能丰富的通用工具库,专为现代 Web 开发和政务端(浙政钉、浙里办)应用设计。
npm install uve-utils
# 或者
yarn add uve-utils
import { utils } from 'uve-utils';
// 手机号校验
utils.checkPhoneNumber('13800138000'); // true
// 身份证校验
utils.checkIdentityId('330101199001011234');
// 日期格式化
utils.dateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss');
// AES 加密
const encrypted = utils.encryptAes('Hello World');
const decrypted = utils.decryptAes(encrypted);
import { initZhezhengding, initZheliban } from 'uve-utils';
// 初始化浙政钉配置
initZhezhengding({
enable: true,
bid: 'your_bid',
signkey: 'your_signkey',
sapp_id: 'your_sapp_id',
sapp_name: 'your_sapp_name'
});
// 初始化浙里办配置
initZheliban({
enable: true,
appTitle: '应用名称',
bid: 'your_bid'
});
| 方法 | 说明 |
|---|---|
checkPhoneNumber(phone) | 验证手机号码格式 |
checkIdentityId(id) | 验证身份证号码合法性 |
isNumber(val) | 判断是否为纯数字 |
numberChinese(num) | 数字转中文大写 |
dateFormat(date, format) | 日期格式化 |
getOsType() | 获取系统类型 (1:IOS, 2:Android, 3:Win, 4:Mac) |
getBrowserType() | 获取浏览器环境 (浙里办, 浙政钉, 微信等) |
hideString(str, start, len) | 字符串脱敏 |
uuid() | 生成唯一标识 |
moneyFormat(num) | 金额千分位格式化 |
encryptAes / decryptAes | AES 加解密 |
encryptSm2 / decryptSm2 | 国密 SM2 加解密 |
encryptSm4 / decryptSm4 | 国密 SM4 加解密 |
| 方法 | 说明 |
|---|---|
createBaseBurialPointZzd(config) | 基础埋点 |
createUserInfoBurialPointZzd(config) | 用户信息埋点 |
getAuthCodeZzd() | 获取免登授权码 (Promise) |
| 方法 | 说明 |
|---|---|
zwlogGlobalZlb(config) | 浙里办全局日志埋点 |
项目采用 Vite 进行构建,输出单文件 bundle。
# 安装依赖
yarn install
# 构建项目
yarn build
构建产物位于 dist 目录:
index.js: ESM 模块index.cjs: CommonJS 模块index.d.ts: 类型声明文件zzd.html/zlb.html: 预置资产文件ISC
FAQs
The npm package uve-utils receives a total of 0 weekly downloads. As such, uve-utils popularity was classified as not popular.
We found that uve-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.