Skip to content

Commit

Permalink
增加不登录就下载上传文件的配置说明
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Aug 5, 2024
1 parent 2d1cb1e commit 9c7b445
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/dev-guide/graphql/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ IOrmEntityFileStore提供了copyFile函数,可以根据指定fileId复制一
* 在NopFileRecord记录上增加了originFileId字段,从同一个NopFileRecord复制得到的记录都具有同样的originFileId值。
* detachFile的时候会检查当前记录是否是最后一个共享originFileId的记录。如果是,则也删除文件存储中的文件,否则只删除对应的NopFileRecord。

## 设置文件允许匿名下载

1. `IOrmEntityFileStore.changePublic(fileId, true)`设置文件允许被公开访问
2. 设置`nop.auth.download-file-public=true`,或者定制`auth-service.beans.xml`中的nopAuthFilterConfig,允许公开访问`/f/download/*`

## 配置变量

* nop.file.store-dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</ioc:condition>
</bean>

<bean id="nopAuthFilterConfig" class="io.nop.auth.core.filter.AuthFilterConfig">
<bean id="nopAuthFilterConfig" class="io.nop.auth.core.filter.AuthFilterConfig" ioc:default="true">
<!-- 未指定的情况下都是公开页面,主要是js/css/image等 -->
<property name="defaultPublic" value="true"/>

Expand All @@ -58,6 +58,7 @@
<value>/q/health*</value>
<value>/q/metrics*</value>
<value feature:on="nop.auth.quarkus-dev-public">/q/*</value>
<value feature:on="nop.auth.download-file-public">/f/download/*</value>
</list>
</property>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ nop:
orm:
init-database-schema: true
db-differ:
auto-upgrade-database: true
auto-upgrade-database: false

# 支持graphql __schema查询,
graphql:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
/nop/autoconfig/nop-auth-sso.beans
/nop/autoconfig/nop-biz.beans
/nop/autoconfig/nop-dao.beans
/nop/autoconfig/nop-dbtool.beans
/nop/autoconfig/nop-gateway.beans
/nop/autoconfig/nop-http-client-jdk.beans
/nop/autoconfig/nop-integration-zxing.beans
Expand Down Expand Up @@ -341,6 +342,7 @@
/nop/dao/dialect/selector/postgresql.selector.yaml
/nop/dao/dialect/tdengine.dialect.xml
/nop/dao/dialect/window-expr-support.dialect.xml
/nop/dbtool/beans/dbtool-defaults.beans.xml
/nop/demo/_module
/nop/demo/app.action-auth.xml
/nop/demo/app.data-auth.xml
Expand Down

0 comments on commit 9c7b445

Please sign in to comment.