From eedf80441e078e70cd33aeb725990555577b4dc8 Mon Sep 17 00:00:00 2001 From: linju Date: Fri, 17 Nov 2023 20:41:01 +0800 Subject: [PATCH] Update index.uvue --- pages/index/index.uvue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pages/index/index.uvue b/pages/index/index.uvue index e7dae33..16c5906 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 '未登录' -- GitLab