- Java File与MultipartFile互转
我在Java摸滚打趴
Java开发工具类java
pom中添加依赖commons-fileuploadcommons-fileupload1.4File转MultipartFile/***File转MultipartFile**@paramfile*@return*/publicstaticMultipartFilecreateFileItem(Filefile){FileItemFactoryfactory=newDiskFileItemFac
- Servlet 文件上传
lly202406
开发语言
Servlet文件上传在JavaWeb开发中,文件上传是一个常见的需求。Servlet作为一种服务器端的技术,可以轻松实现文件上传功能。本文将详细介绍如何在Servlet中处理文件上传,包括环境配置、代码实现以及常见问题的解决方案。环境配置1.添加依赖在项目的pom.xml文件中,添加ApacheCommonsFileUpload库的依赖。这个库提供了易于使用的API来处理文件上传。commons
- Java 上传读取Excel文件
Ben_1043556915
Java进阶javaservlet开发语言
Web中導入Excel文件ExtJs前端代碼://=========上傳Excel=============================uploadPanel=newExt.form.FormPanel({fileUpload:true,id:'fileUploadForm',frame:true,labelAlign:'right',buttonAlign:'center',labelWid
- 文件上传和下载
提笔忘字_波
一、概论在Web应用系统开发中,文件上传和下载功能是非常常用的功能,今天来讲一下JavaWeb中的文件上传和下载功能的实现。对于文件上传,浏览器在上传的过程中是将文件以流的形式提交到服务器端的,如果直接使用Servlet获取上传文件的输入流然后再解析里面的请求参数是比较麻烦,所以一般选择采用apache的开源工具common-fileupload这个文件上传组件。这个common-fileuplo
- DVWA通关之File Upload
CoOlCoKeZ
文件上传FileUpload,通常是由于对上传文件的类型,内容没有进行严格的过滤,检查,使得攻击者可以通过上传木马获取服务器的webshell权限,因此文件上传带来的危害常常是毁灭性的,Apache,Tomcat,Nginx等都爆出过文件上传漏洞。利用文件上传,我们可以上传我们的一句话木马,很方便的会获得系统shell。Low:源码分析一下:Yourimagewasnotuploaded.';}e
- ASP.NET使用FileUpLoad控件实现图片上传并显示
pcdd
.NETasp.net
后端代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.IO;namespaceex{publicpartialclassWebForm1:System.Web.UI.
- Spring MVC 简单文件上传
Bridge Fish
Springspringmvcjava
1.添加依赖commons-fileuploadcommons-fileupload1.3.12.配置文件上传解析器3.测试编写controller@Controller@RequestMapping("/account")publicclassAccountController{@RequestMapping(path="/upload")publicStringupload(HttpServl
- element-ui 中 使用<el-upload></el-upload>组件,第二次点击上传无反应
今天星期八
vue.js前端javascriptelementui
出现问题:在vue项目中使用el-upload组件,实现文件上传的功能,第一次点击可以上传,第二次点击按钮无反应出现此问题的原因:由于上次上传的文件流还在,未被清除解决办法:通过ref与组件进行关联导入在上传成功的函数中进行清空流文件handleAvatarSuccess(response,file,fileList){this.$refs.fileUploadBtn.clearFiles();/
- Mino基于JAVA API 对文件对象的基础操作封装
michelle-q
Miniojava
/***@authorqianxm*@date2020/6/3016:58*/@Log4jpublicclassMinioUtils{publicstaticvoidfileUpload(Stringendpoint,StringaccessKey,StringsecrtKey,StringbucketName,Stringfilename,Stringfilepath)throwsExcepti
- 基于django的视频点播网站开发-step9-后台视频管理功能
山东好汉Tim
毕业设计合集python
从本讲开始,我们开始视频管理功能的开发,视频管理包括视频上传、视频列表、视频编辑、视频删除。另外还有视频分类的功能,会一同讲解。这一讲非常重要,因为你将学习到一些之前没有学过的技术,比如大文件上传技术。视频上传我们先来实现视频的上传,视频的上传采用的是分块上传的策略,并用了分块上传类库:django_chunked_upload,使用该类库,再配合前端上传js库(jquery.fileupload
- EsayExcel文件导入导出
开朗觉觉
java服务器前端
目录准备工作监听器类导入测试导出测试上传Excel下载Excel混合导出+模板导出headRowNumber(1):从第几行开始读准备工作导入依赖com.alibabaxeasyexcel2.2.6commons-fileuploadcommons-fileupload1.4创建实体类@HeadRowHeight():设置导出的Excle表格标题的行高@ExcelProperty():对当前列的操
- 抽象工厂模式-Abstract Factory Pattern
大扑棱蛾子
抽象工厂模式java开发语言设计模式面向对象
原文地址:https://jaune162.blog/design-pattern/abstract-factory-pattern/引言首先我们由一个实际问题来引出抽象工厂模式。考虑这样一个场景,系统中需要向OSS上传文件,以及通过OSS下载文件。而在系统中有不同的业务在使用这两个功能。如下图:伪代码如下publicinterfaceFileUploader{/***上传文件**@paramfi
- C# WinFrom+AspNetCore WebApi实现大文件下载与上传
漂泊_人生
c#javamysql
客户端UI:服务端WebApi:客户端代码:App.config:自定义进度条:CustomProgressBar.cs(长方形)usingSystem;usingSystem.Windows.Forms;usingSystem.Drawing;namespaceFileUploadAndDown{publicclassCustomProgressBar:ProgressBar{//添加一个属性来
- bugku 1
木…
android
Flask_FileUpload文件上传先随便传个一句话木马看看回显果然不符合规定而且发现改成图片什么的都不行查看页面源代码,发现提示那应该就要用python命令才行试试ls类型要改成图片cat/flag好像需要密码bp爆破根据提示,我们先抓包爆破得到密码12328得到flag文件包含点一下尝试直接访问看样子要用php://filter协议?file=php://filter/read=conve
- @RequestParam和@RequestPart区别及Feign踩坑
johnny233
概述在做视频文件上传时遇到的问题,参考FileUploadException:therequestwasrejectedbecausenomultipartboundarywasfound。@RequestParam绝大多数人都知道RequestParam,看看源码:/***Annotationwhichindicatesthatamethodparametershouldbeboundtoawe
- DVWA靶场下载安装
默默提升实验室
信息安全靶场
DVWA介绍DVWA一共包含了十个攻击模块,分别是:BruteForce(暴力破解)、CommandInjection(命令行注入)、CSRF(跨站请求伪造)、FileInclusion(文件包含)、FileUpload(文件上传)、InsecureCAPTCHA(不安全的验证码)、SQLInjection(SQL注入)、SQLInjectionBlind(SQL盲注)、XSSReflected(
- Java中上传数据的安全性探讨与实践
喔的嘛呀
java开发语言
目录引言一.文件上传的风险二.使用合适的框架和库1.Spring框架的MultipartFile2.ApacheCommonsFileUpload3.ApacheCommonsIO三.文件上传路径的安全设置1.将上传目录放置在Web根目录之外2.限制上传目录的权限3.避免使用可执行文件上传目录4.使用随机化的子目录结构5.配置Web服务器阻止直接访问上传目录6.使用安全的文件名7.定期清理上传目录
- 百度的web Uploader使用心得
my_ cache
插件
我们做的这个项目,表单比较多,附件也比较多,一个表单可能有好几个附件字段,包括单附件,多附件。项目用的前端框架bootstrap,最开始的时候我是用了bootstrap的fileupload插件(这个插件也是很强大),不过我们的项目需求比较特殊,提交完表单后有一个信息确认页面,在这个确认页面上有修改按钮,可以跳回那个表单进行修改,这样问题就出来了,浏览器是不允许给file类型的input赋值的,研
- Linux mount.nfs: access denied by server while mounting
tmaczt
linuxlinux
nfs远程挂载异常mount-tnfs172.*.*.13:/app/tomcat/webapps/test/fileUpload/app/tomcat/webapps/test/fileUploadmount.nfs:accessdeniedbyserverwhilemounting172.*.*.13:/app/tomcat/webapps/test/fileUpload解决方案#修改NFS配
- SpringBootServletInitializer说明
_江屿_
JavaSpringBootjavaspringboot
启动springboot项目的方式方式一:通过运行主程序main方法,默认的application启动,在创建项目时自动生成application启动类,直接run执行即可。方式二:默认启动类集成SpringBootServletInitiallizer,并重写configure()方法@SpringBootApplicationpublicclassFileuploadApplicationex
- 上传文件el-upload
开水没有冬天
上传
文章目录上传报错Blob详解Refusedtogetunsafeheader"content-disposition"xxxx手动触发,用el-upload组件的this.$refs['fileUpload'].submit()触发http-request函数:onUpload(file){console.log('onUpload-custom:file:',file)letformData=n
- parseRequest(request)为空的问题
en_reading
JavastrutsWeb项目
我之前照着孤傲苍狼的博客写了文件上传的代码,用的是servlet,后来学了新的知识,就添加了struts2.5框架。在改动前端web样式时发现文件上传不能用了,debug之后发现request的确正常提交了form表单,但Listlist=upload.parseRequest(request);始终为空。在认真拜读了commons-fileupload源码之后,确定不是这个jar的问题。真正的问
- 解析HTTP协议实现文件上传
攻城狮_正
在J2EE开发中,使用浏览器上传文件很简单,服务器用Apache的CommonsFileUpload实现就可以了。但是在开发C/S架构的程序时就需要自己处理。用代码实现文件上传需要对表单的multipart/form-data有所了解。表单默认情况下使用application/x-www-form-urlencoded,在multipart/form-data中Content-Type是这样的:C
- 文件上传下载、Excel导入导出
十点 vha
excel
主要内容文件上传重点文件下载重点生成Excel重点解析Excel重点Excel导入导出重点章节目标掌握文件上传掌握文件下载掌握Excel生成与解析掌握Excel导入导出第一节文件上传和下载1.文件处理的包commons-io.jar封装了常用的IO的相关操作,提供了IOUtils工具类供开发人员使用commons-fileupload.jar文件上传的处理包,因为文件上传也会涉及到IO操作,因此,
- dvwa中的文件上传漏洞
青霄
安全web安全dvwa文件上传漏洞
环境:Metasploitable2:192.168.11.157dvwa版本:Version1.0.7(Releasedate:08/09/10)kail机器:192.168.11.156一、什么是文件上传漏洞?文件上传(FileUpload)是大部分Web应用都具备的功能,例如用户上传附件、修改头像、分享图片/视频等。正常的文件一般是文档、图片、视频等,Web应用收集之后放入后台存储,需要的时
- struts2上传文件时,关于在action里面获取上传文件的文件名
董林刚
Strutsfile文件上传
在struts2中有个文件上传的拦截器FileUploadInterceptor在它的intercept中我们可以找到答案。贴源码:publicStringintercept(ActionInvocationinvocation)throwsException{ActionContextac=invocation.getInvocationContext();HttpServletRequestr
- Spring Boot 中文件上传
小宝945
#SpringMVC#SpringBootspringboot后端
SpringBoot中文件上传一、MultipartFile二、单文件上传案例三、多文件上传案例四、Servlet规范五、Servlet规范实现文件上传上传文件大家用的最多的就是ApacheCommonsFileUpload,这个库使用非常广泛。SpringBoot3版本中已经不能使用了。代替它的是SpringBoot中自己实现的文件上传。SpringBoot上传文件现在变得非常简单。提供了封装好
- Pikachu靶场之越权漏洞详解
caker丶
网络安全pikachu安全web安全逻辑越权漏洞网络安全系统安全
Pikachu靶场之越权漏洞详解前言逻辑越权漏洞简述漏洞描述漏洞原因漏洞分类水平越权垂直越权权限框架缺陷如何防御第一关水平越权问题分析尝试防御第二关垂直越权问题分析尝试防御前言本篇文章用于巩固对自己逻辑越权漏洞的学习总结,其中部分内容借鉴了以下博客。链接:pikachuUnsafeFileupload不安全的文件上传(pikachuOverpermission越权(皮卡丘漏洞平台通关系列))链接:
- How to Show Files‘ Content in Web?
进击切图仔
前端
Visualizingafileuploadedbyauserinacanvastypicallyinvolvesafewsteps:receivingthefileinput,processingorreadingthefile,andthendrawingordisplayingitonthecanvas.Thespecificstepscanvarydependingonthetypeoff
- 如何使用ssm框架实现文件上传?
潇洒不放纵的博客
javajava
这篇文章将会给大家提到如何实现图片上传,1.首先,搭建好ssm框架,并在WEB-INF下的lib包底下引入2个jar包,commons-fileupload-1.2.1.jarcommons-io-1.4.jar下载地址:https://pan.baidu.com/s/1iNQ0ekCeTJ2tIGMqaCwFtw提取码:w24t下载路径我百度云盘提供一个版本,也可以自己在网上找,在此我们模拟用户
- LeetCode[Math] - #66 Plus One
Cwind
javaLeetCode题解AlgorithmMath
原题链接:#66 Plus One
要求:
给定一个用数字数组表示的非负整数,如num1 = {1, 2, 3, 9}, num2 = {9, 9}等,给这个数加上1。
注意:
1. 数字的较高位存在数组的头上,即num1表示数字1239
2. 每一位(数组中的每个元素)的取值范围为0~9
难度:简单
分析:
题目比较简单,只须从数组
- JQuery中$.ajax()方法参数详解
AILIKES
JavaScriptjsonpjqueryAjaxjson
url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址。
type: 要求为String类型的参数,请求方式(post或get)默认为get。注意其他http请求方法,例如put和 delete也可以使用,但仅部分浏览器支持。
timeout: 要求为Number类型的参数,设置请求超时时间(毫秒)。此设置将覆盖$.ajaxSetup()方法的全局
- JConsole & JVisualVM远程监视Webphere服务器JVM
Kai_Ge
JVisualVMJConsoleWebphere
JConsole是JDK里自带的一个工具,可以监测Java程序运行时所有对象的申请、释放等动作,将内存管理的所有信息进行统计、分析、可视化。我们可以根据这些信息判断程序是否有内存泄漏问题。
使用JConsole工具来分析WAS的JVM问题,需要进行相关的配置。
首先我们看WAS服务器端的配置.
1、登录was控制台https://10.4.119.18
- 自定义annotation
120153216
annotation
Java annotation 自定义注释@interface的用法 一、什么是注释
说起注释,得先提一提什么是元数据(metadata)。所谓元数据就是数据的数据。也就是说,元数据是描述数据的。就象数据表中的字段一样,每个字段描述了这个字段下的数据的含义。而J2SE5.0中提供的注释就是java源代码的元数据,也就是说注释是描述java源
- CentOS 5/6.X 使用 EPEL YUM源
2002wmj
centos
CentOS 6.X 安装使用EPEL YUM源1. 查看操作系统版本[root@node1 ~]# uname -a Linux node1.test.com 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux [root@node1 ~]#
- 在SQLSERVER中查找缺失和无用的索引SQL
357029540
SQL Server
--缺失的索引
SELECT avg_total_user_cost * avg_user_impact * ( user_scans + user_seeks ) AS PossibleImprovement ,
last_user_seek ,
 
- Spring3 MVC 笔记(二) —json+rest优化
7454103
Spring3 MVC
接上次的 spring mvc 注解的一些详细信息!
其实也是一些个人的学习笔记 呵呵!
- 替换“\”的时候报错Unexpected internal error near index 1 \ ^
adminjun
java“\替换”
发现还是有些东西没有刻子脑子里,,过段时间就没什么概念了,所以贴出来...以免再忘...
在拆分字符串时遇到通过 \ 来拆分,可是用所以想通过转义 \\ 来拆分的时候会报异常
public class Main {
/*
- POJ 1035 Spell checker(哈希表)
aijuans
暴力求解--哈希表
/*
题意:输入字典,然后输入单词,判断字典中是否出现过该单词,或者是否进行删除、添加、替换操作,如果是,则输出对应的字典中的单词
要求按照输入时候的排名输出
题解:建立两个哈希表。一个存储字典和输入字典中单词的排名,一个进行最后输出的判重
*/
#include <iostream>
//#define
using namespace std;
const int HASH =
- 通过原型实现javascript Array的去重、最大值和最小值
ayaoxinchao
JavaScriptarrayprototype
用原型函数(prototype)可以定义一些很方便的自定义函数,实现各种自定义功能。本次主要是实现了Array的去重、获取最大值和最小值。
实现代码如下:
<script type="text/javascript">
Array.prototype.unique = function() {
var a = {};
var le
- UIWebView实现https双向认证请求
bewithme
UIWebViewhttpsObjective-C
什么是HTTPS双向认证我已在先前的博文 ASIHTTPRequest实现https双向认证请求
中有讲述,不理解的读者可以先复习一下。本文是用UIWebView来实现对需要客户端证书验证的服务请求,网上有些文章中有涉及到此内容,但都只言片语,没有讲完全,更没有完整的代码,让人困扰不已。但是此知
- NoSQL数据库之Redis数据库管理(Redis高级应用之事务处理、持久化操作、pub_sub、虚拟内存)
bijian1013
redis数据库NoSQL
3.事务处理
Redis对事务的支持目前不比较简单。Redis只能保证一个client发起的事务中的命令可以连续的执行,而中间不会插入其他client的命令。当一个client在一个连接中发出multi命令时,这个连接会进入一个事务上下文,该连接后续的命令不会立即执行,而是先放到一个队列中,当执行exec命令时,redis会顺序的执行队列中
- 各数据库分页sql备忘
bingyingao
oraclesql分页
ORACLE
下面这个效率很低
SELECT * FROM ( SELECT A.*, ROWNUM RN FROM (SELECT * FROM IPAY_RCD_FS_RETURN order by id desc) A ) WHERE RN <20;
下面这个效率很高
SELECT A.*, ROWNUM RN FROM (SELECT * FROM IPAY_RCD_
- 【Scala七】Scala核心一:函数
bit1129
scala
1. 如果函数体只有一行代码,则可以不用写{},比如
def print(x: Int) = println(x)
一行上的多条语句用分号隔开,则只有第一句属于方法体,例如
def printWithValue(x: Int) : String= println(x); "ABC"
上面的代码报错,因为,printWithValue的方法
- 了解GHC的factorial编译过程
bookjovi
haskell
GHC相对其他主流语言的编译器或解释器还是比较复杂的,一部分原因是haskell本身的设计就不易于实现compiler,如lazy特性,static typed,类型推导等。
关于GHC的内部实现有篇文章说的挺好,这里,文中在RTS一节中详细说了haskell的concurrent实现,里面提到了green thread,如果熟悉Go语言的话就会发现,ghc的concurrent实现和Go有点类
- Java-Collections Framework学习与总结-LinkedHashMap
BrokenDreams
LinkedHashMap
前面总结了java.util.HashMap,了解了其内部由散列表实现,每个桶内是一个单向链表。那有没有双向链表的实现呢?双向链表的实现会具备什么特性呢?来看一下HashMap的一个子类——java.util.LinkedHashMap。
- 读《研磨设计模式》-代码笔记-抽象工厂模式-Abstract Factory
bylijinnan
abstract
声明: 本文只为方便我个人查阅和理解,详细的分析以及源代码请移步 原作者的博客http://chjavach.iteye.com/
package design.pattern;
/*
* Abstract Factory Pattern
* 抽象工厂模式的目的是:
* 通过在抽象工厂里面定义一组产品接口,方便地切换“产品簇”
* 这些接口是相关或者相依赖的
- 压暗面部高光
cherishLC
PS
方法一、压暗高光&重新着色
当皮肤很油又使用闪光灯时,很容易在面部形成高光区域。
下面讲一下我今天处理高光区域的心得:
皮肤可以分为纹理和色彩两个属性。其中纹理主要由亮度通道(Lab模式的L通道)决定,色彩则由a、b通道确定。
处理思路为在保持高光区域纹理的情况下,对高光区域着色。具体步骤为:降低高光区域的整体的亮度,再进行着色。
如果想简化步骤,可以只进行着色(参看下面的步骤1
- Java VisualVM监控远程JVM
crabdave
visualvm
Java VisualVM监控远程JVM
JDK1.6开始自带的VisualVM就是不错的监控工具.
这个工具就在JAVA_HOME\bin\目录下的jvisualvm.exe, 双击这个文件就能看到界面
通过JMX连接远程机器, 需要经过下面的配置:
1. 修改远程机器JDK配置文件 (我这里远程机器是linux).
 
- Saiku去掉登录模块
daizj
saiku登录olapBI
1、修改applicationContext-saiku-webapp.xml
<security:intercept-url pattern="/rest/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<security:intercept-url pattern=&qu
- 浅析 Flex中的Focus
dsjt
htmlFlexFlash
关键字:focus、 setFocus、 IFocusManager、KeyboardEvent
焦点、设置焦点、获得焦点、键盘事件
一、无焦点的困扰——组件监听不到键盘事件
原因:只有获得焦点的组件(确切说是InteractiveObject)才能监听到键盘事件的目标阶段;键盘事件(flash.events.KeyboardEvent)参与冒泡阶段,所以焦点组件的父项(以及它爸
- Yii全局函数使用
dcj3sjt126com
yii
由于YII致力于完美的整合第三方库,它并没有定义任何全局函数。yii中的每一个应用都需要全类别和对象范围。例如,Yii::app()->user;Yii::app()->params['name'];等等。我们可以自行设定全局函数,使得代码看起来更加简洁易用。(原文地址)
我们可以保存在globals.php在protected目录下。然后,在入口脚本index.php的,我们包括在
- 设计模式之单例模式二(解决无序写入的问题)
come_for_dream
单例模式volatile乱序执行双重检验锁
在上篇文章中我们使用了双重检验锁的方式避免懒汉式单例模式下由于多线程造成的实例被多次创建的问题,但是因为由于JVM为了使得处理器内部的运算单元能充分利用,处理器可能会对输入代码进行乱序执行(Out Of Order Execute)优化,处理器会在计算之后将乱序执行的结果进行重组,保证该
- 程序员从初级到高级的蜕变
gcq511120594
框架工作PHPandroidhtml5
软件开发是一个奇怪的行业,市场远远供不应求。这是一个已经存在多年的问题,而且随着时间的流逝,愈演愈烈。
我们严重缺乏能够满足需求的人才。这个行业相当年轻。大多数软件项目是失败的。几乎所有的项目都会超出预算。我们解决问题的最佳指导方针可以归结为——“用一些通用方法去解决问题,当然这些方法常常不管用,于是,唯一能做的就是不断地尝试,逐个看看是否奏效”。
现在我们把淫浸代码时间超过3年的开发人员称为
- Reverse Linked List
hcx2013
list
Reverse a singly linked list.
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
p
- Spring4.1新特性——数据库集成测试
jinnianshilongnian
spring 4.1
目录
Spring4.1新特性——综述
Spring4.1新特性——Spring核心部分及其他
Spring4.1新特性——Spring缓存框架增强
Spring4.1新特性——异步调用和事件机制的异常处理
Spring4.1新特性——数据库集成测试脚本初始化
Spring4.1新特性——Spring MVC增强
Spring4.1新特性——页面自动化测试框架Spring MVC T
- C# Ajax上传图片同时生成微缩图(附Demo)
liyonghui160com
1.Ajax无刷新上传图片,详情请阅我的这篇文章。(jquery + c# ashx)
2.C#位图处理 System.Drawing。
3.最新demo支持IE7,IE8,Fir
- Java list三种遍历方法性能比较
pda158
java
从c/c++语言转向java开发,学习java语言list遍历的三种方法,顺便测试各种遍历方法的性能,测试方法为在ArrayList中插入1千万条记录,然后遍历ArrayList,发现了一个奇怪的现象,测试代码例如以下:
package com.hisense.tiger.list;
import java.util.ArrayList;
import java.util.Iterator;
- 300个涵盖IT各方面的免费资源(上)——商业与市场篇
shoothao
seo商业与市场IT资源免费资源
A.网站模板+logo+服务器主机+发票生成
HTML5 UP:响应式的HTML5和CSS3网站模板。
Bootswatch:免费的Bootstrap主题。
Templated:收集了845个免费的CSS和HTML5网站模板。
Wordpress.org|Wordpress.com:可免费创建你的新网站。
Strikingly:关注领域中免费无限的移动优
- localStorage、sessionStorage
uule
localStorage
W3School 例子
HTML5 提供了两种在客户端存储数据的新方法:
localStorage - 没有时间限制的数据存储
sessionStorage - 针对一个 session 的数据存储
之前,这些都是由 cookie 完成的。但是 cookie 不适合大量数据的存储,因为它们由每个对服务器的请求来传递,这使得 cookie 速度很慢而且效率也不