diff --git a/pages/index/index.uvue b/pages/index/index.uvue index e7dae3361f12f93cb74f30e51a3042274abbabc0..16c59064b170a01bef554c4bf7c33f67372b4d1b 100644 --- a/pages/index/index.uvue +++ b/pages/index/index.uvue @@ -32,11 +32,18 @@ }, openName():string{ if(this.isLogin){ - const nickname = userInfo['nickname'] as string; + let nickname = userInfo.getString("nickname") + let username = userInfo.getString("username") + if(nickname == null){ + nickname = ""; + } + if(username == null){ + username = ""; + } if(nickname.length != 0){ return nickname }else{ - return userInfo['username'] as string + return username } }else{ return '未登录'