GeezerVison is showing github.com — MySQL:更新表;Demo:APIJSONFinal 解决远程函数 verifyAccess 判断角色的方式错误 · oliavn/APIJSON-Demo@f9e49be
File tree
Expand file treeCollapse file tree
Open diff view settings
APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/DemoFunctionParser.java +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
28 | 28 | import apijson.RequestMethod; |
29 | 29 | import apijson.StringUtil; |
30 | 30 | import apijson.framework.APIJSONFunctionParser; |
| 31 | +import apijson.orm.AbstractVerifier; |
31 | 32 | import apijson.orm.JSONRequest; |
32 | 33 |
|
33 | 34 |
|
@@ -212,7 +213,7 @@ public JSONArray getIdList(@NotNull JSONObject current) { |
212 | 213 | public Object verifyAccess(@NotNull JSONObject current) throws Exception { |
213 | 214 | long userId = current.getLongValue(JSONRequest.KEY_USER_ID); |
214 | 215 | String role = current.getString(JSONRequest.KEY_ROLE); |
215 | | - if (role == apijson.orm.AbstractVerifier.OWNER && userId != DemoVerifier.getVisitorId(getSession())) { |
| 216 | + if (AbstractVerifier.OWNER.equals(role) && userId != DemoVerifier.getVisitorId(getSession())) { |
216 | 217 | throw new IllegalAccessException("登录用户与角色OWNER不匹配!"); |
217 | 218 | } |
218 | 219 | return null; |
|
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Access.sql +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -61,4 +61,4 @@ UNLOCK TABLES; |
61 | 61 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
62 | 62 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
63 | 63 |
|
64 | | --- Dump completed on 2021-10-20 4:58:02 |
| 64 | +-- Dump completed on 2021-10-23 23:52:28 |
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Comment.sql +3-3Lines changed: 3 additions & 3 deletions Large diffs are not rendered by default.
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Document.sql +4-3Lines changed: 4 additions & 3 deletions Large diffs are not rendered by default.
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Function.sql +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -58,4 +58,4 @@ UNLOCK TABLES; |
58 | 58 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
59 | 59 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
60 | 60 |
|
61 | | --- Dump completed on 2021-10-20 4:57:16 |
| 61 | +-- Dump completed on 2021-10-23 23:51:50 |
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Login.sql +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -50,4 +50,4 @@ UNLOCK TABLES; |
50 | 50 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
51 | 51 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
52 | 52 |
|
53 | | --- Dump completed on 2021-10-20 4:58:00 |
| 53 | +-- Dump completed on 2021-10-23 23:52:32 |
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Method.sql +3-3Lines changed: 3 additions & 3 deletions Large diffs are not rendered by default.
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Moment.sql +3-3Lines changed: 3 additions & 3 deletions Large diffs are not rendered by default.
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Praise.sql +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -50,4 +50,4 @@ UNLOCK TABLES; |
50 | 50 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
51 | 51 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
52 | 52 |
|
53 | | --- Dump completed on 2021-10-20 4:57:55 |
| 53 | +-- Dump completed on 2021-10-23 23:52:29 |
Collapse file
Copy file name to clipboardExpand all lines: MySQL/single/sys_Random.sql +3-3Lines changed: 3 additions & 3 deletions Large diffs are not rendered by default.