随笔分类 - 前端
一些前端框架等技术
摘要:bcrypt 加密 引入 npm i bcrypt -S 代码 加密 const bcrypt = require("bcrypt") const salt = bcrypt.genSaltSync(10); const hash = bcrypt.hashSync(password, salt);
阅读全文
摘要:流程 前端js使用公钥进行加密,后端使用私钥进行解密(C#或java语言)。 注意:c#使用xml格式的公钥/私钥 Java,js都是pem格式 格式 xml: <RSAKeyValue><Modulus> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </Modulus>
阅读全文
摘要:方法 1.模拟vue的路由拦截(未尝试) 2.进入页面拦截(模拟后台管理系统) route v6常用属性 页面梳理 路由表 公共路由 权限路由 layout(+权限判定) 登录 页面布局 路由表 点击查看代码 //menus.js const menus = [ { key: "0-0", path
阅读全文
摘要:效果 前情提要 后端传excel坐标数据,前端自己处理模板,找资料后,选择直接载入xlsx方式。 准备工作 npm i xlsx import * as XLSX from 'xlsx' 方法一:数据处理渲染 导入 提取数据 let reader = new FileReader() //读入fil
阅读全文
摘要:问题描述 因为项目需求,实时播放执行信息。而项目的websoket只在这个页面,会有切换情况。从websoket连接得到执行列表数据。断开重连后会传递新连接数据+旧连接数据。也就是说,如果第一次进入页面,播放list【0】的数据,第二次会播放2次list【0】,第三次进入会播放3次list【0】。在
阅读全文
摘要:使用场景 后端传递嵌套数据 菜单权限等 树结构转数组 /** * 树结构转数组 * @param {Object} arr 树结构 */ export const treeToList = (arr) => { let tree = JSON.parse(JSON.stringify(arr));
阅读全文
摘要:文字转语音 SpeechSynthesisUtterance是HTML5中新增的API,用于将指定文字合成为对应的语音 function sayTTS(content) { const synth = window.speechSynthesis; const msg = new SpeechSyn
阅读全文
摘要:1.按钮 <el-button @mousedown="down" @touchstart="down" @mousemove="move" @touchmove="move" @mouseup="end" @touchend="end" @touchcancel="end" > </el-butt
阅读全文
摘要:
主要技术 MediaRecorder 录音 webrtc 获取麦克风 URL.createObjectURL 转换为url(实际生产中,通过后端转换blob为mp3网址) 实现elementui+vue 1.html <div class="chat-record"> <audio ref="cha
阅读全文
