Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b1a60b4

Browse files
author
jack
committedDec 24, 2017
Spring Boot + Security + JPA 完美 集成 React( Nowa )前端工程。
权限控制很 easy, 同时可以享受 React 前端开发的绝妙体验! componentDidMount() { console.log(`URLS.fetchCurrentUserUrl = ${URLS.fetchCurrentUserUrl}`) var u = localStorage.getItem("username") if (!u) { $.get(URLS.fetchCurrentUserUrl, function (result) { try { var currentUser = JSON.parse(result); console.log(`currentUser = ${currentUser}`) u = currentUser.loginUser.username localStorage.setItem("username", u) } catch (e) { // 如果 JSON.parse 解析异常,尝试直接对象访问 console.log(e) currentUser = result; console.log(`currentUser = ${currentUser}`) u = currentUser.loginUser.username localStorage.setItem("username", u) } }.bind(this)); } this.setState({ username: u }); }
1 parent 8dee3b0 commit b1a60b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1375
-388
lines changed
 

‎build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ dependencies {
5353
runtime('mysql:mysql-connector-java')
5454
testCompile('org.springframework.boot:spring-boot-starter-test')
5555
testCompile('org.springframework.security:spring-security-test')
56+
57+
// https://mvnrepository.com/artifact/com.alibaba/fastjson
58+
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.44'
59+
5660
}
5761

5862
// 自定义 kor 插件的输入参数: entity 自动生成实体类,Dao 层,Controller 层的模板代码
5963
korArgs {
60-
entity = 'Article'
64+
entity = 'Demo'
6165
}

‎front/abc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"variables":"app/variables.js"
2323
},
2424
"mockapi": {
25-
"/mock/user/query.json": "mock/user/query.js"
25+
"/mock/user/query.json": "mock/user/query.js",
26+
"/mock/user/currentUser.json": "mock/user/currentUser.js"
2627
}
2728
}
2829
}

0 commit comments

Comments
 (0)
Please sign in to comment.