\\
func userLogin(username:String,password:String,success: @escaping (()->Void)){
_ = LCUser.logIn(username: username, password: password) { result in
switch result {
//登录成功
// 得到user : result
case .success(object: let user):
let avatarLCValue = user.get("avatar") as? LCString
let avatar = avatarLCValue?.jsonString
//更新本地user数据
userSelf = User(username: username, avatar: avatar)
//获取用户相关信息
let userBookMap = LCQuery(className: "UserBookMap")
userBookMap.whereKey("user", .equalTo(user))
_ = userBookMap.find(){(result) in
switch result{
case .success(objects: let objects):
print("success",objects)
for object in objects{
let book = object["book"] as! LCObject
let a = book.get("face") as? LCString
if let aa = a{
let b = aa.jsonString
// let name = namelc?.jsonString
print(b)
}
}
case .failure(error: let error):
print("(error)///error:搜索结果为空")
}
}
case .failure(error: let error):
print(error)
}
}
}
\\