ログインに問題があります。私はネットからいくつかの例を試しましたが、何も私のために働きました。メールアドレスとパスワードを使用してログイン後の更新
JSON
{
"responseCode":1,
"responseCodeText":"ok",
"response":
{
"id":1234,
"email":"[email protected]",
"name":"name",
"lastname":"lastname",
"properties":[
//...
],
"rights":"admin",
"photo":"url",
"favorites":
[
//...
],
"token":"token"
}
}
私はhttp://www.jsonschema2pojo.org/からモデルクラスを作成しているので、それはOKでなければなりません。活動の
インタフェース
public interface LoginInterface {
@POST("login/{email}/{password}")
Call<UserResponse> login(@Path("email") String email, @Path("password") String password);
}
コール私が持っている
public void serviceInit() {
String email = edEmail.getText().toString();
String password = edPassword.getText().toString();
FactoryAPI.getInstanceLogin().login(email, password).enqueue(new Callback<UserResponse>() {
@Override
public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
if(response.isSuccessful()) {
Intent intent = new Intent(getContext(), AccountActivity.class);
startActivity(intent);
}
//TODO: load from sharedPreferences
}
@Override
public void onFailure(Call<UserResponse> call, Throwable t) {
Log.e("error", "points not loaded");
}
});
}
ERROR
responseCodeText: "属性エラー"
私はサーバーからリクエストを受け取りました。私のメールアドレスとパスワードを助け
あなたはどのようなエラーを取得していますか? –
あなたはどんな問題に直面していますか? –
あなたの質問を編集して、エラーの説明を含めてください。 – theFunkyEngineer