上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 87 下一页
摘要: expressjwt() 是一个 Express 中间件,用于验证 JWT(JSON Web Tokens)。它会检查请求头中是否存在 Authorization 字段,并且该字段的值是否是符合 JWT 规范的格式。如果 JWT 有效并且签名正确,则它会将 JWT 解码后的负载对象作为 req.au 阅读全文
posted @ 2023-03-19 00:37 槑孒 阅读(347) 评论(0) 推荐(0)
摘要: 如上图所示,我需要监听layerList的变化,代码如下: import useLayersStore from "@/store/modules/layers"; const layersStore = useLayersStore(); watch( () => userStore.layerL 阅读全文
posted @ 2023-03-18 21:54 槑孒 阅读(326) 评论(0) 推荐(0)
摘要: 1、在css中使用变量 (1)css中声明变量 --color:red (2)使用变量 color:var(--color) //color:red获取到全局声明变量值为red 2、使用vue中的变量 (1) 在html标签中 <span :style="{'--color':变量color}" r 阅读全文
posted @ 2023-03-18 21:05 槑孒 阅读(1473) 评论(0) 推荐(0)
摘要: import { useRoute, useRouter } from 'vue-router' const router = useRouter() const route = useRoute() router.push({ path: '/index'}) 这种在正常.vue文件中引入没有任何 阅读全文
posted @ 2023-03-18 20:50 槑孒 阅读(1035) 评论(0) 推荐(2)
摘要: 验证码实现思路 前端也可是生产验证码,但是前端如果生成简单的验证码,很容易就被爬虫破解,无法很好的起到一个人机识别的效果。而后端生成验证码图片发送给前端,这样的人机识别效果比较好。 验证码流程如下: 前端发送get请求来获取验证码图片。需要前端生成uuid并把uuid的值传到后端; 后端收到前端的生 阅读全文
posted @ 2023-03-18 00:39 槑孒 阅读(175) 评论(0) 推荐(0)
摘要: nanoid库和uuid库一样都可以生成uuid,但是nanoid相比uuid要更轻量级, https://github.com/ai/nanoid 使用nanoid的使用 1.在项目目录下打开终端,下载安装nanoid库 npm i nanoid 或者,如果你安装了yarn可以使用: yarn a 阅读全文
posted @ 2023-03-18 00:15 槑孒 阅读(400) 评论(0) 推荐(0)
摘要: 1、安装 npm i svg-captcha 2、后端接口 const express = require('express') const router = express.Router() // 解析以 application/json 和 application/x-www-form-urle 阅读全文
posted @ 2023-03-17 01:12 槑孒 阅读(560) 评论(0) 推荐(0)
摘要: 待解构字段为原始值 正常情况下 const obj = { a: 1, b: 2}; const { a, b } = obj; console.log(a, b); // 1 2 当被解构字段缺失时 const obj = { a: 1,}; const { a, b } = obj; conso 阅读全文
posted @ 2023-03-16 09:17 槑孒 阅读(1257) 评论(0) 推荐(0)
摘要: 1、为什么使用 nodemon (1)在编写调试 Node.js 项目的时候,如果修改了项目的代码,则需要频繁的手动 close 掉,然后再重新启动,非常繁琐。现在,我们可以使用 nodemon 工具包 这个工具,它能够监听项目文件的变动,当代码被修改后,nodemon 会自动帮我们重启项目,极大方 阅读全文
posted @ 2023-03-10 22:17 槑孒 阅读(120) 评论(0) 推荐(0)
摘要: v-contextmenu-github v-contextmenu-doc v-contextmenu-预览 可以非常快速实现鼠标右键菜单O(∩_∩)O~ 阅读全文
posted @ 2023-02-26 21:48 槑孒 阅读(1864) 评论(0) 推荐(0)
上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 87 下一页