Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
e775de19
"source/java/src/vscode:/vscode.git/clone" did not exist on "2ff992eea0f84555ca76906a93216b6ed3f85357"
Commit
e775de19
authored
Aug 22, 2019
by
dqjdda
Browse files
代码生成器优化,配置更方便
parent
e471a9da
Changes
2
Hide whitespace changes
Inline
Side-by-side
eladmin-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java
View file @
e775de19
...
@@ -5,6 +5,8 @@ import me.zhengjie.repository.GenConfigRepository;
...
@@ -5,6 +5,8 @@ import me.zhengjie.repository.GenConfigRepository;
import
me.zhengjie.service.GenConfigService
;
import
me.zhengjie.service.GenConfigService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.io.File
;
import
java.util.Optional
;
import
java.util.Optional
;
/**
/**
...
@@ -30,6 +32,22 @@ public class GenConfigServiceImpl implements GenConfigService {
...
@@ -30,6 +32,22 @@ public class GenConfigServiceImpl implements GenConfigService {
@Override
@Override
public
GenConfig
update
(
GenConfig
genConfig
)
{
public
GenConfig
update
(
GenConfig
genConfig
)
{
genConfig
.
setId
(
1L
);
genConfig
.
setId
(
1L
);
// 自动设置Api路径,注释掉前需要同步取消前端的注释
String
separator
=
File
.
separator
;
String
[]
paths
=
null
;
if
(
separator
.
equals
(
"\\"
))
{
paths
=
genConfig
.
getPath
().
split
(
"\\\\"
);
}
else
paths
=
genConfig
.
getPath
().
split
(
File
.
separator
);
StringBuffer
api
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
paths
.
length
;
i
++)
{
api
.
append
(
paths
[
i
]);
api
.
append
(
separator
);
if
(
paths
[
i
].
equals
(
"src"
)){
api
.
append
(
"api"
);
break
;
}
}
genConfig
.
setApiPath
(
api
.
toString
());
return
genConfigRepository
.
save
(
genConfig
);
return
genConfigRepository
.
save
(
genConfig
);
}
}
}
}
eladmin-system/src/main/resources/config/application-dev.yml
View file @
e775de19
...
@@ -45,8 +45,8 @@ spring:
...
@@ -45,8 +45,8 @@ spring:
jwt
:
jwt
:
header
:
Authorization
header
:
Authorization
secret
:
mySecret
secret
:
mySecret
# token 过期时间
2
个小时
# token 过期时间
6
个小时
expiration
:
7
200000
expiration
:
2
10
00000
auth
:
auth
:
# 授权路径
# 授权路径
path
:
/login
path
:
/login
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment