egg RESTful

Method Path Route Name Controller.Action GET /posts posts app.controllers.posts.index GET /posts/new new_post app.controllers.posts.new GET /posts/:id p...

egg 上传文件

#route.js中添加一个路由规则 router.post('/upload',controller.upload.index); 在controller中新建upload文件 'use strict'; //node.js 文件操作对象 const fs = require('fs'); //nod...

egg使用jwt验证

原理:vue前端登录,提交账号密码给egg后端,后端比对信息后,使用jsonwebtoken对用户信息进行签名生成token,之后通过cookie返回给vue前端,前端需要使用token里的信息就使用js-base64进行token第二段解码即可。 vue前端路由跳转,进入路由前置守卫检测cookie中...

常用util

/** * 存储localStorage */ export const setStore = (name, content) => { if (!name) return; if (typeof content !== 'string') { content = JSON.stringify(cont...

v2ray

https://www.v2ray.com/chapter_00/install.html https://sixu.life/cloudflare-v2ray-ip.html caddy -conf /etc/caddy/Caddyfile --agree nohup /usr/local/bin/c...

axios上传文件

二、实现方法 1、读取文件 通过input标签,我们可以得到一个file文件将这个file进行处理。 <input class="upload" type="file" ref="upload" accept="image/jpeg,image/jpg,image/png" @change="uploa...

linux挂载google Drive

安装 Rclone Linux或macOS有多种安装方式,这里选择脚本安装: curl https://rclone.org/install.sh | sudo bash install.sh #!/usr/bin/env bash # error codes # 0 - exited without...