Skip to content

Commit

Permalink
fix: needless AuthUtils on some case
Browse files Browse the repository at this point in the history
  • Loading branch information
taccisum committed Oct 9, 2019
1 parent 06679be commit f23a843
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ $ yo deepexi-spring-cloud --help
|RDBMS|✅MySQL|☑️PG SQL|☑️SQL Server|
|NoSQL|✅Redis|☑️MongoDB|
|连接池|✅Druid|☑️Hikari|
|认证机制|✅JWT|
|权限控制|✅Shiro|☑️Spring Security|
|分布式事务|☑️TCC-Transaction|☑️LCN|
|APM|☑️SkyWalking|☑️Zipkin|☑️PinPoint|
Expand Down
4 changes: 4 additions & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ module.exports = require('yo-power-generator').getGenerator(obj, {
props.conditions[props.configservice] = true;
}

if (props.authentication !== 'none') {
props.conditions[props.authentication] = true;
}

if (props.security !== 'none') {
props.conditions[props.security] = true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package ${basePackage}.util;

<%
switch (authentication) {
case 'jwt':
print(`
import com.github.taccisum.shiro.web.autoconfigure.stateless.support.jwt.JWTPrincipal;
import com.github.taccisum.shiro.web.autoconfigure.stateless.support.jwt.Payload;
import org.apache.shiro.SecurityUtils;
Expand All @@ -21,10 +17,3 @@ private static JWTPrincipal getPrincipal() {
return (JWTPrincipal) SecurityUtils.getSubject().getPrincipal();
}
}
`)
break;

default:
break;
}
%>

0 comments on commit f23a843

Please sign in to comment.