摘要: /** * 域名校验 eg: www.baidu.com * @param {*} val 需要校验的值 */ export function isDomain(val) { const reg = /^([0-9a-zA-Z-]{1,}\.)+([a-zA-Z]{2,})$/; return re 阅读全文
posted @ 2023-07-26 14:45 正经的流刺源 阅读(1046) 评论(0) 推荐(0) 编辑
摘要: 目的: 通过点击页面上的一个导入excel文件的按钮,将选中的excel的文件导入,然后拿到文件中的内容。 实现步骤: 1. 页面上放一个按钮,用一个type为file的input标签(它是一个用于导入文件的dom)css定位在按钮上然后可以通过opacity:0 隐藏掉input标签,这样的话看着 阅读全文
posted @ 2022-07-15 18:23 正经的流刺源 阅读(3612) 评论(0) 推荐(0) 编辑
摘要: 1、首先看没处理时接口返回的数据,会发现是乱码的。。。 2、解决乱码需要在请求接口时,加上配置responseType: 'blob',例如在vue中使用axios的http请求 加上之后返回的数据就是这样的 3、接下来就是处理数据文件并下载 const url = window.URL.creat 阅读全文
posted @ 2022-02-25 16:04 正经的流刺源 阅读(2501) 评论(0) 推荐(0) 编辑
摘要: 前言 在Nginx服务器上配置Basic_Auth认证后,浏览器输入网址,将会弹出一个登录认证框,输入用户名和密码后方可进入网站。 实现步骤: 1. 没有安装httpd-tools,先安装 yum install httpd-tools -y 2. 生成用户名密码文件 htpasswd -c -d 阅读全文
posted @ 2021-11-18 15:37 正经的流刺源 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 一、安装 1.首先进入虚机中,切换到一个目录(用于下载nodejs包) 例如: cd /mydir/download 2.用命令下载相关版本nodejs包(nodejs官网https://nodejs.org/en/download/) 例如: wget https://nodejs.org/dis 阅读全文
posted @ 2021-11-16 18:25 正经的流刺源 阅读(1543) 评论(0) 推荐(0) 编辑
摘要: function BinarySearchTree() { this.root = null; this.count = 0; // 内部类 存放节点的信息 function Node(key) { this.key = key; this.left = null; this.right = nul 阅读全文
posted @ 2021-06-01 15:01 正经的流刺源 阅读(64) 评论(0) 推荐(0) 编辑
摘要: // 基于对象封装一个集合 function Set() { // 属性 this.items = {}; // 方法 // add 往集合中添加元素 Set.prototype.add = function (value) { // 先判断是否有这个元素 if (this.has(value)) 阅读全文
posted @ 2021-06-01 14:57 正经的流刺源 阅读(182) 评论(0) 推荐(0) 编辑
摘要: // 基于数组封装一个哈希表 function HashTable() { // 属性 this.storage = []; this.count = 0; // 数据的存储量 this.limit = 7; // 容量长度最好为质数,利于数据在容器中均匀分布 // 方法 // 哈希函数 HashT 阅读全文
posted @ 2021-06-01 14:55 正经的流刺源 阅读(92) 评论(0) 推荐(0) 编辑
摘要: // 封装一个双向链表 function DoublyLinkedList() { // 内部属性 this.head = null; this.tail = null; this.length = 0; // 内部类,存放节点的数据和指针 function Node(data) { this.da 阅读全文
posted @ 2021-06-01 14:51 正经的流刺源 阅读(69) 评论(0) 推荐(0) 编辑
摘要: // 封装链表 function LinkedList(){ // 创建一个內部类,用于存节点的数据和指针 function Node(data){ this.data = data; this.next = null; } // 链表头 this.head = null; // 链表长度 this 阅读全文
posted @ 2021-06-01 14:49 正经的流刺源 阅读(131) 评论(0) 推荐(0) 编辑