forked from zfile-dev/zfile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43c12aa
commit 3b6e2be
Showing
3 changed files
with
69 additions
and
32 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/main/java/im/zhaojun/zfile/controller/admin/DebugController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package im.zhaojun.zfile.controller.admin; | ||
|
||
|
||
import im.zhaojun.zfile.model.support.ResultBean; | ||
import im.zhaojun.zfile.service.SystemConfigService; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
|
||
import javax.annotation.Resource; | ||
|
||
@Controller | ||
public class DebugController { | ||
|
||
@Value("${zfile.debug}") | ||
private Boolean debug; | ||
|
||
@Resource | ||
private SystemConfigService systemConfigService; | ||
|
||
@GetMapping("/debug/resetPwd") | ||
public ResultBean resetPwd() { | ||
if (debug) { | ||
systemConfigService.updateUsernameAndPwd("admin", "123456"); | ||
return ResultBean.success(); | ||
} else { | ||
return ResultBean.error("未开启 DEBUG 模式,不允许进行此操作。"); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,34 @@ | ||
zfile: | ||
debug: false | ||
log: | ||
path: ${user.home}/.zfile/logs | ||
db: | ||
path: ${user.home}/.zfile/db/zfile | ||
tmp: | ||
path: ${user.home}/.zfile/tmp | ||
cache: | ||
auto-refresh: | ||
interval: 1 | ||
timeout: 1800 | ||
constant: | ||
readme: readme.md | ||
password: password.txt | ||
preview: | ||
audio: | ||
maxFileSizeMb: 5 | ||
text: | ||
maxFileSizeKb: 512 | ||
onedrive: | ||
clientId: 09939809-c617-43c8-a220-a93c1513c5d4 | ||
clientSecret: _l:[email protected]@B/On6Q | ||
redirectUri: https://zfile.jun6.net/onedrive/callback | ||
scope: offline_access User.Read Files.ReadWrite.All | ||
onedrive-china: | ||
clientId: 4a72d927-1907-488d-9eb2-1b465c53c1c5 | ||
clientSecret: Y9CEA=82da5n-y_]KAWAgLH3?R9xf7Uw | ||
redirectUri: https://zfile.jun6.net/onedrive/china-callback | ||
scope: offline_access User.Read Files.ReadWrite.All | ||
|
||
server: | ||
port: 8080 | ||
servlet: | ||
|
@@ -13,7 +44,7 @@ spring: | |
settings: | ||
web-allow-others: true | ||
path: /h2-console | ||
enabled: false | ||
enabled: ${zfile.debug} | ||
datasource: | ||
# 初始化数据导入 | ||
data: classpath*:db/data.sql | ||
|
@@ -47,34 +78,4 @@ spring: | |
chain: | ||
gzipped: true | ||
profiles: | ||
active: prod | ||
|
||
zfile: | ||
log: | ||
path: ${user.home}/.zfile/logs | ||
db: | ||
path: ${user.home}/.zfile/db/zfile | ||
tmp: | ||
path: ${user.home}/.zfile/tmp | ||
cache: | ||
auto-refresh: | ||
interval: 1 | ||
timeout: 1800 | ||
constant: | ||
readme: readme.md | ||
password: password.txt | ||
preview: | ||
audio: | ||
maxFileSizeMb: 5 | ||
text: | ||
maxFileSizeKb: 512 | ||
onedrive: | ||
clientId: 09939809-c617-43c8-a220-a93c1513c5d4 | ||
clientSecret: _l:[email protected]@B/On6Q | ||
redirectUri: https://zfile.jun6.net/onedrive/callback | ||
scope: offline_access User.Read Files.ReadWrite.All | ||
onedrive-china: | ||
clientId: 4a72d927-1907-488d-9eb2-1b465c53c1c5 | ||
clientSecret: Y9CEA=82da5n-y_]KAWAgLH3?R9xf7Uw | ||
redirectUri: https://zfile.jun6.net/onedrive/china-callback | ||
scope: offline_access User.Read Files.ReadWrite.All | ||
active: prod |