WishMeLz

生活其实很有趣

ElementUi table合并

merageArr: any = [] // 每个列应该合并的rowspan index为列的序号 其value为需要合并的数值 merageIndex = 0 merge(){ // 避免筛选合并时出现错行 this.dataList = this.dataList.sort((a,b)=> a.rId-b.rId) // 遍历数组 通过一个key判断是否与上一项相同 // 结果类似于:[3,0,0,2,0] 第一个合并3行,剩下的两个为0...

Mac 虚拟机UTM

https://mac.getutm.app/ https://mac.getutm.app/support/Shift + F10 打开CMD 命令视窗(要同时按FN键,Shift + F10+ FN) OOBE\BYPASSNRO

JS修改input的value触发change事件

var inp = document.querySelector('input'); var ev = new Event('input', { bubbles: true }); ev.simulated = true; inp.value = 'new value' inp.dispatchEvent(ev);

JS生成字母A-Z

var arr = []; for(var i = 65; i < 91; i++){ arr.push(String.fromCharCode(i)); } return arr;

多级目录将数据递归成树状

let data = [ { id: 1, name: "电器", parentid: 0 }, { id: 2, name: "日用品", parentid: 0 }, { id: 3, name: "车用品", parentid: 0 }, { id: 4, name: "电饭煲", parentid: 1 }, { id: 5, name: "毛巾", parentid: 2 }, { id: 6, name: "雨刷器", parentid: 3 }, { id: 7, nam...

express 请求者IP

正常情况下:console.log(req.ip); // ::ffff:123.23.12.1使用nginx代理后: location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwarded-For $proxy_add...

随机图片API

https://s.file.itsse.cn/tool/api/v1/bg每次请求都是随机图片, 如下是预览图.图片包地址: https://www.aliyundrive.com/s/P7Ad98uXWRh

随机数random.org

https://www.random.org/integers/?num=500&min=0&max=12&col=1&base=10&format=plain&rnd=new 其中: num: 随机多少个 min:其中最小的数 max:其中最大的数

服务器综合测试工具 LemonBench

快速测试: wget -qO- https://cdn.jsdelivr.net/gh/WishMelz/file/2022/LemonBenchIntl.sh | bash -s fast 完整测试: wget -qO- https://cdn.jsdelivr.net/gh/WishMelz/file/2022/LemonBenchIntl.sh | bash -s full 测试结果会发送到一个公共平台上.

UnixBench工具跑分测试(一)

wget https://cdn.jsdelivr.net/gh/WishMelz/file/2022/UnixBench5.1.3.tgz tar -xf UnixBench5.1.3.tgz cd UnixBench5.1.3 make ./Run等待即可问题make: gcc: Command not found make: *** [pgms/arithoh] Error 127 yum -y install gcc Can't locate Time/HiRes.pm or Can't locate Time/HiR...

TikTok

博主教程视频:https://www.youtube.com/channel/UCPD2Q2Rak0W5r8MNRRgOqywShadowrocket https://www.youtube.com/watch?v=vfeCQ98uhJI https://itiktok.best/3.17更新 Shadowrocket https://www.youtube.com/watch?v=wwgVhmBnURM 3.18 圈X https://www.youtube.com/watch?v=0W7Lu8e2sms

nodejs 反向代理 http-proxy-middleware

const express = require('express'); const app = express(); const proxy = require('http-proxy-middleware'); const port = 3000 const bodyParser = require('body-parser'); app.use(require('cors')()) app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json(...

时间API

苏宁: https://f.m.suning.com/api/ct.do or http://quan.suning.com/getSysTime.do { "api": "time", "code": "1", "currentTime": 1647506518039, "msg": "" } or { "sysTime2": "2022-03-17 16:46:39", "sysTime1": "20220317164639" } 淘宝: http://api.m.taoba...

Nodejs+Express 权限下载文件

先请求一个TOKEN(以用户生成,并且设置过期时间). 以token做验证去下载.或者直接发送登录的token下载 const express = require('express'); const app = express(); const port = 51413; const bodyParser = require('body-parser'); app.use(require('cors')()) app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyP...

Nodejs+Express+Vue 分片上传文件

Vue<template> <div class="upload"> <el-upload :before-upload="befUpload" class="upload-demo" drag action="/" :show-file-list="false" > <el-icon class="el-icon--upload"><upload-filled /></el-icon> <div cla...

Axios封装 2.0

import axios from "axios"; import { Notify } from 'vant'; // 这个是异常提醒弹框. vant或者ele的,在或者其他的 import router from '@/router'; // 做跳转 //下面三个是错误处理. 底下的拦截判断出异常. 这里通过 errorCreate new一个Error, 然后在使用 errorLog 打印出来在页面提示一下. 可以直接写成提示的 function errorCreate(msg) { const error = new Er...