细节完善
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user