细节优化
This commit is contained in:
@@ -5,7 +5,7 @@ const defaultUser = {
|
||||
nickName: "游客",
|
||||
avatar: "../static/avatar.png",
|
||||
trio: 0, // 大于1表示完成了新手引导
|
||||
lvlName: "砖石1级",
|
||||
lvlName: "",
|
||||
};
|
||||
|
||||
const getLvlName = (score, rankList = []) => {
|
||||
@@ -80,7 +80,7 @@ export default defineStore("store", {
|
||||
const imageInfo = await uni.getImageInfo({ src: user.avatar });
|
||||
this.user.avatar = imageInfo.path;
|
||||
}
|
||||
if (this.user.scores) {
|
||||
if (this.user.scores !== undefined) {
|
||||
this.user.lvlName = getLvlName(this.user.scores, this.config.randInfos);
|
||||
const lvlImage = getLvlImage(this.user.scores, this.config.randInfos);
|
||||
if (lvlImage) {
|
||||
@@ -95,7 +95,7 @@ export default defineStore("store", {
|
||||
},
|
||||
async updateConfig(config) {
|
||||
this.config = config;
|
||||
if (this.user.scores) {
|
||||
if (this.user.scores !== undefined) {
|
||||
this.user.lvlName = getLvlName(this.user.scores, this.config.randInfos);
|
||||
const lvlImage = getLvlImage(this.user.scores, this.config.randInfos);
|
||||
if (lvlImage) {
|
||||
|
||||
Reference in New Issue
Block a user