note  Linux常用命令
1
2
3
4
5
6
7
8
9
$ls -l 
- 简写为ll -查看目录下文件

$less file
? 向上查找
/ 向下查找

n 使用查找后,跳到下个匹配位置
N 跳至上一个匹配位置

正则表达式搜索文件:

1
2
3
4
$egrep -i -a1 'loadWithdrawalacc[a-zA-Z -]+0324'  2goportal.log
-i 忽略大小写
-b1 匹配前一行
-a1 包含被匹配后一行
1
2
3
su  #进入root权限
exit #退出su 进入的root权限
su test #切换用户为 test

编辑

1
2
vi /test.txt
:%s/aaa/bbb/g #批量替换 aaa 为 bbb
note  html5 & javascript 笔记

html5 + javascript

文件下载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://192.168.7.128:8080/download');
xhr.onprogress = function(e) {
if (e.lengthComputable) {
console.log(e.loaded + ' / ' + e.total);
}
};
xhr.onloadstart = function(e) {
console.log('start');
};
xhr.onloadend = function(e) {
console.log('end');
};
xhr.send({
form: JSON.stringify({
id: 1
})
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* PC 文件下载
* @param {Object} params
* @param {Blob} params.blob
* @param {String} params.fileName
*/
export function fileDownload(params) {
const uA = window.navigator.userAgent
const isIE =
/msie\s|trident\/|edge\//i.test(uA) &&
!!(
'uniqueID' in document ||
'documentMode' in document ||
'ActiveXObject' in window ||
'MSInputMethodContext' in window
)
const isEdge = uA.indexOf('Edge') > -1

if (isIE || isEdge) {
navigator.msSaveBlob(params.blob, params.fileName)
} else {
const url = window.URL.createObjectURL(params.blob)
const link = document.createElement('a')
link.setAttribute('style', 'display:none')
link.setAttribute('id', 'download')
link.setAttribute('href', url)
link.setAttribute('download', params.fileName)
document.body.appendChild(link)
link.click()
link.addEventListener('click', function() {
URL.revokeObjectURL(url)
document.getElementById('download').remove()
})
}
}
note  Spring boot+ mybatis + Spring security 集成

Spring boot+ mybatis + Spring security 集成

项目使用 Maven 管理依赖

引入 Spring Security 库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>26.0-jre</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8</version>
</dependency>
note  tomcat

Jul 26, 2018 11:01:02 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more Filters failed to start. Full details will be found in the appropriate container log file
Jul 26, 2018 11:01:02 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
web exit …