修正从服务器获取用户信息消息格式错误

This commit is contained in:
MrZ626
2021-04-23 10:17:28 +08:00
parent f12356beb4
commit 754a8f611f
2 changed files with 2 additions and 3 deletions

View File

@@ -141,7 +141,7 @@ function NET.getUserInfo(uid)
WS.send("user",JSON.encode{
action=1,
data={
id=uid,
uid=uid,
hash=hash,
},
})

View File

@@ -36,7 +36,7 @@ local db=setmetatable({},{__index=function(self,k)
{
username="[X]",
motto="Techmino haowan",
hash="",
hash="_",
new=false,
}
rawset(self,k,d)
@@ -61,7 +61,6 @@ function USERS.updateUserData(data)
fs.write("cache/"..data.hash,love.data.decode("string","base64",data.avatar:sub(data.avatar:find","+1)))
db_img[uid]=loadAvatar("cache/"..data.hash)
db[uid].hash=type(data.hash)=="string"and #data.hash>0 and data.hash
db[uid].new=true
end
end