【发布时间】:2018-12-26 21:25:19
【问题描述】:
我创建了新的 MobileServiceClient。我可以通过配置的身份提供者登录并让表格正常工作。
mUserLoginTable = mClient.getTable("User_Login", UserLogin.class);
当我尝试检查登录的用户是否存在于我的表中时发生问题。
第一个版本:
mUserLoginTable.where().field("facebook_id").eq(_user.getUserId()).execute().get();
第二版:
public boolean ChekIfGoogeUserExists() throws ExecutionException, InterruptedException {
AsyncTask<Void, Void, Boolean> task = new AsyncTask<Void, Void, Boolean>(){
@Override
protected Boolean doInBackground(Void... params) {
try {
List<UserLogin> result;
ListenableFuture<MobileServiceList<UserLogin>> future = mUserLoginTable.where().field("google_id").eq(_user.getUserId()).execute();
return future.get().isEmpty();
} catch (Exception exception) {
return false;
}
}
};
return runAsyncTask(task).get();
}
似乎没有任何工作,android 只是挂起请帮助!
我使用 SqlServer 在我的天蓝色数据库中创建了 User_Login 表。然后我添加了带有“User_Login”名称的 Azure MobileService EasyTable。它从数据库中正确找到并映射了 User_Login 表(列是自动添加的)。现在访问设置为匿名。
我已经在 AppServiceEditor 中为 User_Login 定义了读取函数:
var table = module.exports = require('azure-mobile-apps').table();
table.read(function (context) {
return context.execute();
});
(默认情况下将其注释掉也无济于事)
【问题讨论】:
-
添加后端跟踪 - 当您打开详细诊断日志记录时,日志会显示什么内容?另外,使用 fiddler 或类似工具查看通信 - 有问题的请求和响应是什么?
-
@Groth 在AppServiceEditor中编辑的
User_Login的代码中似乎没有任何查询操作。有更新吗?
标签: android azure mobile azure-mobile-services