Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdisk
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdisk
提交
3f759eb6
提交
3f759eb6
编写于
9月 22, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
免登
上级
0538fb01
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
16 行增加
和
28 行删除
+16
-28
webSecurityConfig.java
...rc/main/java/cn/ibizlab/web/config/webSecurityConfig.java
+1
-5
DevBootSecurityConfig.java
...rc/main/java/cn/ibizlab/config/DevBootSecurityConfig.java
+1
-5
DiskCoreService.java
...ibizlab/core/disk/extensions/service/DiskCoreService.java
+1
-1
apiSecurityConfig.java
...rc/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
+1
-5
DiskCoreResource.java
...java/cn/ibizlab/api/rest/extensions/DiskCoreResource.java
+12
-12
未找到文件。
ibzdisk-app/ibzdisk-app-web/src/main/java/cn/ibizlab/web/config/webSecurityConfig.java
浏览文件 @
3f759eb6
...
...
@@ -118,11 +118,7 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
.
antMatchers
(
"/"
+
previewpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/download/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/edit/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/ocrview/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/preview/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/files/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/wopi/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/**view/**"
).
permitAll
()
// 所有请求都需要认证
.
anyRequest
().
authenticated
()
// 防止iframe 造成跨域
...
...
ibzdisk-boot/src/main/java/cn/ibizlab/config/DevBootSecurityConfig.java
浏览文件 @
3f759eb6
...
...
@@ -118,11 +118,7 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
.
antMatchers
(
"/"
+
previewpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/download/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/edit/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/ocrview/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/preview/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/files/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/wopi/**"
).
permitAll
();
.
antMatchers
(
"/net-disk/**view/**"
).
permitAll
();
for
(
String
excludePattern
:
excludesPattern
)
{
...
...
ibzdisk-core/src/main/java/cn/ibizlab/core/disk/extensions/service/DiskCoreService.java
浏览文件 @
3f759eb6
...
...
@@ -129,7 +129,7 @@ public class DiskCoreService {
return
getFile
(
""
,
fileId
,
""
);
}
public
File
getFile
(
String
folder
,
String
fileId
,
String
authcode
)
{
if
(
StringUtils
.
isEmpty
(
folder
))
if
(
StringUtils
.
isEmpty
(
folder
)
||
folder
.
equals
(
"download"
)
)
folder
=
"ibizutil"
;
if
(
folder
.
toLowerCase
().
startsWith
(
"ibizutil"
))
{
String
dirpath
=
this
.
fileRoot
.
concat
(
folder
).
concat
(
File
.
separator
).
concat
(
fileId
.
replace
(
"_"
,
File
.
separator
));
...
...
ibzdisk-provider/ibzdisk-provider-api/src/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
浏览文件 @
3f759eb6
...
...
@@ -123,11 +123,7 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
.
antMatchers
(
"/"
+
previewpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/download/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/edit/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/ocrview/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/preview/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/files/**"
).
permitAll
()
.
antMatchers
(
"/net-disk/wopi/**"
).
permitAll
();
.
antMatchers
(
"/net-disk/**view/**"
).
permitAll
();
for
(
String
excludePattern
:
excludesPattern
)
{
authenticationTokenFilter
.
addExcludePattern
(
excludePattern
);
...
...
ibzdisk-provider/ibzdisk-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/DiskCoreResource.java
浏览文件 @
3f759eb6
...
...
@@ -90,7 +90,7 @@ public class DiskCoreResource
@GetMapping
(
value
=
{
"net-disk/download/{folder}/{id}/{name}.{ext}"
,
"{folder}/download/{id}"
})
@GetMapping
(
value
=
{
"net-disk/download/{folder}/{id}/{name}.{ext}"
,
"
net-disk/download/{id}"
,
"
{folder}/download/{id}"
})
@ResponseStatus
(
HttpStatus
.
OK
)
public
void
download
(
@PathVariable
(
"folder"
)
String
folder
,
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
value
=
"name"
,
required
=
false
)
String
name
,
@PathVariable
(
value
=
"ext"
,
required
=
false
)
String
ext
,
...
...
@@ -101,7 +101,7 @@ public class DiskCoreResource
this
.
sendRespose
(
response
,
file
);
}
@GetMapping
(
value
=
"net-disk/files/{folder}/{id}/{name}.{ext}"
)
@GetMapping
(
value
=
{
"net-disk/openview/{folder}/{id}/{name}.{ext}"
,
"net-disk/files/{folder}/{id}/{name}.{ext}"
}
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
void
open
(
@PathVariable
(
"folder"
)
String
folder
,
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
"name"
)
String
name
,
@PathVariable
(
"ext"
)
String
ext
,
...
...
@@ -132,7 +132,7 @@ public class DiskCoreResource
return
ResponseEntity
.
ok
().
body
(
true
);
}
@Value
(
"
ibiz.file.proxy.previewpath:http://172.16.100.243:8012/onlinePreview?url=
"
)
@Value
(
"
${ibiz.file.proxy.previewpath:http://172.16.100.243:8012/onlinePreview?url=}
"
)
private
String
previewPath
;
@GetMapping
(
value
=
"net-disk/preview/{folder}/{id}/{name}.{ext}"
)
...
...
@@ -148,13 +148,13 @@ public class DiskCoreResource
String
redirectUrl
=
request
.
getScheme
().
concat
(
"://"
).
concat
(
request
.
getServerName
());
if
(
request
.
getServerPort
()!=
80
&&
request
.
getServerPort
()!=
443
)
redirectUrl
=
redirectUrl
.
concat
(
":"
).
concat
(
request
.
getServerPort
()+
""
);
redirectUrl
=
redirectUrl
.
concat
(
"/net-disk/
download
/"
)
redirectUrl
=
redirectUrl
.
concat
(
"/net-disk/
openview
/"
)
.
concat
(
folder
).
concat
(
"/"
).
concat
(
id
).
concat
(
"/"
).
concat
(
name
).
concat
(
"."
).
concat
(
ext
).
concat
(
"?authcode="
).
concat
(
StringUtils
.
isEmpty
(
authcode
)?
checkcode:
authcode
);
redirectUrl
=
previewPath
.
concat
(
""
).
concat
(
encodeURIComponent
(
redirectUrl
));
return
ResponseEntity
.
status
(
HttpStatus
.
MOVED_PERMANENTLY
).
header
(
HttpHeaders
.
LOCATION
,
redirectUrl
).
build
();
}
@Value
(
"
ibiz.file.proxy.ocrpath:http://101.132.236.47:58114/ocr/view?url=
"
)
@Value
(
"
${ibiz.file.proxy.ocrpath:http://101.132.236.47:58114/ocr/view?url=}
"
)
private
String
ocrPath
;
@GetMapping
(
value
=
"net-disk/ocrview/{folder}/{id}/{name}.{ext}"
)
...
...
@@ -172,16 +172,16 @@ public class DiskCoreResource
String
redirectUrl
=
request
.
getScheme
().
concat
(
"://"
).
concat
(
request
.
getServerName
());
if
(
request
.
getServerPort
()!=
80
&&
request
.
getServerPort
()!=
443
)
redirectUrl
=
redirectUrl
.
concat
(
":"
).
concat
(
request
.
getServerPort
()+
""
);
redirectUrl
=
redirectUrl
.
concat
(
"/net-disk/
download
/"
)
redirectUrl
=
redirectUrl
.
concat
(
"/net-disk/
openview
/"
)
.
concat
(
folder
).
concat
(
"/"
).
concat
(
id
).
concat
(
"/"
).
concat
(
name
).
concat
(
"."
).
concat
(
ext
).
concat
(
"?authcode="
).
concat
(
StringUtils
.
isEmpty
(
authcode
)?
checkcode:
authcode
);
redirectUrl
=
ocrPath
.
concat
(
""
).
concat
(
encodeURIComponent
(
redirectUrl
));
return
ResponseEntity
.
status
(
HttpStatus
.
MOVED_PERMANENTLY
).
header
(
HttpHeaders
.
LOCATION
,
redirectUrl
).
build
();
}
@Value
(
"
ibiz.file.proxy.editpath:http://172.16.180.233:9980/loleaflet/dist/loleaflet.html?file_path=
"
)
@Value
(
"
${ibiz.file.proxy.editpath:http://172.16.180.233:9980/loleaflet/dist/loleaflet.html?file_path=}
"
)
private
String
editPath
;
@GetMapping
(
value
=
"net-disk/edit/{folder}/{id}/{name}.{ext}"
)
@GetMapping
(
value
=
{
"net-disk/editview/{folder}/{id}/{name}.{ext}"
,
"net-disk/edit/{folder}/{id}/{name}.{ext}"
}
)
public
ResponseEntity
editview
(
@PathVariable
(
"folder"
)
String
folder
,
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
"name"
)
String
name
,
@PathVariable
(
"ext"
)
String
ext
,
@RequestHeader
(
value
=
"authcode"
,
required
=
false
)
String
authcode
,
...
...
@@ -196,13 +196,13 @@ public class DiskCoreResource
String
redirectUrl
=
request
.
getScheme
().
concat
(
"://"
).
concat
(
request
.
getServerName
());
if
(
request
.
getServerPort
()!=
80
&&
request
.
getServerPort
()!=
443
)
redirectUrl
=
redirectUrl
.
concat
(
":"
).
concat
(
request
.
getServerPort
()+
""
);
redirectUrl
=
redirectUrl
.
concat
(
"/net-disk/wopi/"
)
redirectUrl
=
redirectUrl
.
concat
(
"/net-disk/wopi
view
/"
)
.
concat
(
folder
).
concat
(
"/"
).
concat
(
id
).
concat
(
"/"
).
concat
(
encodeURIComponent
(
name
)).
concat
(
"."
).
concat
(
ext
);
redirectUrl
=
editPath
.
concat
(
""
).
concat
(
redirectUrl
);
return
ResponseEntity
.
status
(
HttpStatus
.
MOVED_PERMANENTLY
).
header
(
HttpHeaders
.
LOCATION
,
redirectUrl
).
build
();
}
@GetMapping
(
value
=
"net-disk/wopi/{folder}/{id}/{name}.{ext}"
)
@GetMapping
(
value
=
"net-disk/wopi
view
/{folder}/{id}/{name}.{ext}"
)
public
ResponseEntity
<
JSONObject
>
getWoAPI
(
@PathVariable
(
"folder"
)
String
folder
,
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
value
=
"name"
,
required
=
false
)
String
name
,
@PathVariable
(
value
=
"ext"
,
required
=
false
)
String
ext
){
...
...
@@ -225,7 +225,7 @@ public class DiskCoreResource
return
ResponseEntity
.
ok
().
body
(
json
);
}
@GetMapping
(
value
=
"net-disk/wopi/{folder}/{id}/{name}.{ext}/contents"
)
@GetMapping
(
value
=
"net-disk/wopi
view
/{folder}/{id}/{name}.{ext}/contents"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
void
getWoAPIContents
(
@PathVariable
(
"folder"
)
String
folder
,
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
value
=
"name"
,
required
=
false
)
String
name
,
@PathVariable
(
value
=
"ext"
,
required
=
false
)
String
ext
,
HttpServletResponse
response
)
{
...
...
@@ -272,7 +272,7 @@ public class DiskCoreResource
}
}
@PostMapping
(
"net-disk/wopi/{folder}/{id}/{name}.{ext}/contents"
)
@PostMapping
(
"net-disk/wopi
view
/{folder}/{id}/{name}.{ext}/contents"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
void
postWoAPIFile
(
@PathVariable
(
"folder"
)
String
folder
,
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
value
=
"name"
,
required
=
false
)
String
name
,
@PathVariable
(
value
=
"ext"
,
required
=
false
)
String
ext
,
@RequestBody
byte
[]
content
)
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录