细节优化

This commit is contained in:
kron
2025-07-14 13:39:10 +08:00
parent d73d52f752
commit cde905c680
15 changed files with 106 additions and 90 deletions

View File

@@ -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) {