I want to use ExtractJSONMap, but in the second layer, I get [Object Object], I need to get "loginName", how do I get that?
Code: Select all
s.s="{`id`:0,`sMessage`:`ok`,`object`:{`_explicitType`:`model.t_user`,`id_user`:`538`,`loginName`:`asdf`,`loginPassHash`:`827ccb0eea8a706c4c34a16`,`displayName`:`\u963f\u65af\u987f\u53d1`,`motto`:``,`email`:``,`money`:`30.50`,`regIP`:`127.0.0.1`,`regTime`:`2021-09-27 11:15:04`,`loginCount`:`0`,`lastLoginTime`:`1900-01-01 00:00:00`,`lastLoginIP`:`0.0.0.0`,`thisLoginTime`:`1900-01-01 00:00:00`,`thisLoginIP`:`0.0.0.0`,`UserMemo`:``,`iIsAdmin`:`0`,`0`:`538`,`1`:`asdf`,`2`:`827ccb0eea8a706c4c34a16`,`3`:`\u963f\u65af\u987f\u53d1`,`4`:``,`5`:``,`6`:`0`,`7`:`127.0.0.1`,`8`:`2021-09-27 11:15:04`,`9`:`0`,`10`:`1900-01-01 00:00:00`,`11`:`0.0.0.0`,`12`:`1900-01-01 00:00:00`,`13`:`0.0.0.0`,`14`:``,`15`:`0`}}";
s=ReplaceString(s,"`",Chr(34)) ;Chr(34)="
Debug s
ParseJSON(0, s)
ObjectValue = JSONValue(0)
NewMap Options()
ExtractJSONMap(JSONValue(0), Options())
Debug Options("id")
Debug Options("sMessage")
Debug Options("object")
; 0
; ok
; [object Object]
user=Options("object")
NewMap userMap()
;ExtractJSONMap(user, userMap()) ;<-- not correct
;userMap=user ;<-- not correct
Debug userMap("_explicitType")