细节完善

This commit is contained in:
kron
2025-07-10 15:34:00 +08:00
parent db419ae003
commit 7972dae398
12 changed files with 144 additions and 112 deletions

View File

@@ -36,6 +36,12 @@ const toPage = (path) => {
icon: "none",
});
}
if (!user.value.trio) {
return uni.showToast({
title: "请先完成新手试炼",
icon: "none",
});
}
}
uni.navigateTo({
url: path,
@@ -52,26 +58,23 @@ onMounted(async () => {
try {
const deviceInfo = uni.getDeviceInfo();
isIos.value = deviceInfo.osName === "ios";
const token = uni.getStorageSync("token");
if (token) {
const result = await getHomeData();
console.log("首页数据:", result);
if (result.user) {
updateUser(result.user);
const devices = await getMyDevicesAPI();
if (devices.bindings && devices.bindings.length) {
updateDevice(
devices.bindings[0].deviceId,
devices.bindings[0].deviceName
);
}
}
}
const config = await getAppConfig();
updateConfig(config);
console.log("全局配置:", config);
const rankList = await getRankListAPI();
updateRank(rankList);
const result = await getHomeData();
console.log("首页数据:", result);
if (result.user) {
updateUser(result.user);
const devices = await getMyDevicesAPI();
if (devices.bindings && devices.bindings.length) {
updateDevice(
devices.bindings[0].deviceId,
devices.bindings[0].deviceName
);
}
}
} catch (error) {
console.error("获取配置失败:", error);
}