str:='http://127.0.0.1:8081/datasnap/rest/tprjmis/web_login/'+AnsiToUtf8(用户名edit.Text)+'/'+ AnsiToUtf8(密码edit.text); str:=AnsiToUtf8(用户名edit.Text); str:=HTTPEncode(str); str:=self.IdHTTP1.Get('http://127.0.0.1:8081/datasnap/rest/tprjmis/web_login/'+httpencode(AnsiToUtf8(用户名edit.Text))+'/'+ HTTPEncode(AnsiToUtf8(密码edit.text)));
json:=tjsonobject.Create; json := TJSONObject.ParseJSONValue(TEncoding.UTF8.GetBytes(str), 0) as TJSONObject; ja:=json.Getvalue('result') as tjsonarray; json:=ja.Items[0] as tjsonobject;
showmessage(json.ToString); json:=json.Getvalue('user') as tjsonobject; showmessage(json.ToString); str:=json.GetValue('_id').ToString; showmessage(str);