Docker

安装yum update –更新yum install -y yum-utils device-mapper-persistent-data lvm2 –依赖yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo –换源yum list docker-ce –showduplicates | sort -r –查看docker版本yum install docker-ce-17.12.1.ce –选择版本安装 常用命令docker start/stop –启动停止docker i...

read more..

Linux操作指令

mv 旧名字 新名字 –改名mv 名字 路径 –移动rm -rf 文件 –删除ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime –修改时区|ln -s /app/nodejs/bin/node /usr/local/bin/ –软连接tar -xvf –解压ps -ef | grep 服务名字 查看配置文件netstat -tunlp|grep 8080 端口占用情况netstat -antp 查看全部服务情况 zip -r  压缩后的文件名  原文件...

read more..

各浏览器的用户代理字符串整理

1. IE 和 IE Mobile 浏览器 WindowsIE 9Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)WindowsIE 10Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)WindowsIE 11Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like GeckoWindows PhoneIE 10Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touc...

read more..

Node/包 管理

锁定Node版本 // package.json "engines":{ "node": "14.x || 16.xp" } // .npmrc engine-strict = true 锁定包 npm install -D only-allow only-allow npm、only-allow pnpm、only-allow yarn // package.json "scripts": { "preinstall": "only-allow npm", ... }

read more..

storage封装

/*** * title: storage.js * Author: wish * Email: - * Time: 2022/7/25 21:32 * last: 2022/7/25 21:54 * Desc: 对存储的简单封装 */ import CryptoJS from 'crypto-js'; // 十六位十六进制数作为密钥 const SECRET_KEY = CryptoJS.enc.Utf8.parse("3333e6e143439161"); // 十六位十六进制数作为密钥偏移量 const SECRET_IV = CryptoJS.enc.Utf8.parse("e3bbe7e3ba84431a"); // 类型 window....

read more..

nodejs 掘金自动签到

const Koa = require('koa'); const schedule = require('node-schedule'); const _request = require('request'); const app = new Koa(); // https://api.juejin.cn/growth_api/v1/check_in? // 自定义 const sessionid = ''; // SessionID const url = ''; // Url const options = { url: url, method:'post', headers: { 'cookie': 'sessionid='+ sessionid, ...

read more..

Vue滑动验证

created() { const url = 'https://ssl.captcha.qq.com/TCaptcha.js' const script = document.createElement('script') script.type = 'text/javascript' script.src = url document.body.appendChild(script) script.onload = () => { console.log(window.TencentCaptcha, 'script已经成功加载') this.getAppid() } }, varify() { ...

read more..

px2rem

npm i postcss-px2rem postcss.config.js module.exports = { plugins: { autoprefixer: { overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8'] }, "postcss-px2rem": { remUnit: 36, // 50px = 1rem remPrecision: 2 // rem的小数点后位数 } } }

read more..

数字千分位

num = 12345.45678 num.toLocaleString('en-US',{minimumFractionDigits:5}) minimumFractionDigits:保留小数几位

read more..

html 导出 pdf

import html2canvas from "html2canvas" import JSPDF from "jspdf" 封装 printPdf.js // 导出页面为PDF格式 import html2canvas from "html2canvas" import JSPDF from "jspdf" export default { // eslint-disable-next-line install (Vue, options) { Vue.prototype.ExportSavePdf = function (htmlTitle, currentTime) { var element = document.getElementById("pdfCent...

read more..