Edit D:\xinhaisoft\crisis_new\api\utils\index.js
module.exports = { /** * ??????????????0????? */ isInteger: s => /^[1-9]\d*$/.test(s), isMD5: s => /^[a-f0-9]{32}$/.test(s), isMobile: s => /^1(3[0-9]|4[579]|5[012356789]|6[267]|7[01235678]|8[0-9]|9[1589])\d{8}$/.test(s), isEmail: s => /^[\w-.]+@([\da-zA-Z-]+\.)+[\da-zA-Z-]{2,3}$/.test(s), isIdList: s => /^([1-9]\d*,)*[1-9]\d*$/.test(s), isDate: s => /^(19|20)\d{2}-((0?[1-9])|(1[0-2]))-((0?[1-9])|([1-2]\d)|30|31)$/.test(s), MD5: s => { const crypto = require('crypto') return crypto.createHash('md5').update(s.toString()).digest('hex') }, /** * ???????????????????????1??????????????16??????2????????????????? */ RndNum: (min, max) => min <= max ? Math.floor(Math.random() * (max - min + 1) + min).toString() : Math.random().toString().slice(-min), /** * ?????P??? */ GuestIP: ctx => { let ip = ctx.header['x-real-ip'] || ctx.header['x-forwarded-for'] || ctx.request.ip ip.includes(':') && (ip = ip.split(':').pop()) return ip.substring(0, 15) } }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de