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..

vue-print-nb 打印

npm i vue-print-nb import Print from 'vue-print-nb' use(Print) <a-button :style="{ marginLeft: '6px' }" v-print="'#printTest'">导出PDF</a-button> #printTest 是打印的容器 printSetting:{ id:"printTest", // 打印的容器ID popTitle:"得膜率图表", // 顶部标签 preview:false, // 是否开启预览 }, 打印的时候可以表格线...

read more..