通过使用 android 实现 Facebook 登录,我需要将令牌发送到我的后端服务器,所以我想知道是否可以删除进度条并创建我自己的进度,在获取 Facebook 令牌并发送到我的服务器后处理。当我打电话时它出现:
LoginManager.getInstance().logInWithReadPermissions(Login.this,Arrays.asList("email"));
Run Code Online (Sandbox Code Playgroud) 我正在尝试列出来自我的服务器的呼叫,但它是空的。在邮递员上,我收到了所有列表,但我无法在 android 上制作。
我有一个模型类:
public class Model {
@SerializedName("Title")
private String Title;
@SerializedName("Price")
private BigDecimal Price;
Run Code Online (Sandbox Code Playgroud)
和来自我的界面的调用:
@GET("api/Host/GetAllEvents")
Call<List<Model>> ListAllEvents();
Run Code Online (Sandbox Code Playgroud)
我的服务等级:
@Override
public void getAllEvents(onFinishedListener onFinishedListener) {
Call<List<Model>> call = retrofitEndpoint.ListAllEvents();
call.enqueue(new Callback<List<Model>>() {
@Override
public void onResponse(@NotNull Call<List<Model>> call, @NotNull Response<List<Model>> response) {
onFinishedListener.onFinished(response.body());
}
@Override
public void onFailure(@NotNull Call<List<Model>> call, @NotNull Throwable t) {
onFinishedListener.onError(t);
}
});
}
Run Code Online (Sandbox Code Playgroud)
我收到列表大小,但属性为空。
我的改造客户端类:
private static final String BASE_URL = "http://192.168.0.101:3000";
private static Retrofit retrofit = null;
private static Gson gson = …Run Code Online (Sandbox Code Playgroud) 我正在尝试以与 ASP.NET MVC 5 相同的方式将表单发布到我的控制器,但它不起作用。
控制器:
[HttpGet]
public IActionResult Login()
{
return View();
}
[HttpPost]
public async Task<IActionResult> Login([FromBody] Login LoginModel)
{
return View();
}
Run Code Online (Sandbox Code Playgroud)
和 HTML
<form asp-action="Login" asp-controller="Home" method="post" class="mt-4">
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label class="text-dark" for="uname">E-mail</label>
<input class="form-control" id="uname" type="text"
placeholder="digite e-mail">
</div>
</div>
<div class="col-lg-12">
<div class="form-group">
<label class="text-dark" for="pwd">Senha</label>
<input class="form-control" id="pwd" type="password"
placeholder="digite sua senha">
</div>
</div>
<div class="col-lg-12 text-center">
<button type="submit" class="btn btn-block btn-dark" />
</div>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
我尝试使用助手:
@using (Html.BeginForm("Login", …Run Code Online (Sandbox Code Playgroud)