修复绑定设备BUG

This commit is contained in:
kron
2025-06-16 00:30:56 +08:00
parent f4be7c597d
commit 39d30fb7ab
6 changed files with 50 additions and 36 deletions

View File

@@ -16,6 +16,14 @@ const props = defineProps({
type: Boolean,
default: false,
},
backgroundColor: {
type: String,
default: "#fed847",
},
color: {
type: String,
default: "#000",
},
});
</script>
@@ -26,7 +34,8 @@ const props = defineProps({
:style="{
width: width,
borderRadius: rounded + 'px',
backgroundColor: disabled ? '#757575' : '#fed847',
backgroundColor: disabled ? '#757575' : backgroundColor,
color,
}"
open-type="getUserInfo"
@click="
@@ -42,14 +51,13 @@ const props = defineProps({
<style scoped>
.sbtn {
margin: 0 auto;
height: 40px;
line-height: 40px;
height: 44px;
line-height: 44px;
font-weight: bold;
font-size: 15px;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: #000;
}
</style>

View File

@@ -57,7 +57,7 @@ const handleLogin = () => {
avatarUrl: avatarUrl.value,
});
const devices = await getMyDevicesAPI();
if (devices.bindings.length) {
if (devices.bindings && devices.bindings.length) {
updateDevice(
devices.bindings[0].deviceId,
devices.bindings[0].deviceName
@@ -96,7 +96,7 @@ const handleLogin = () => {
type="nickname"
class="nickname-input"
placeholder="请输入昵称"
placeholder-style="color: #ccc"
placeholder-style="color: #ccc"
@change="onNicknameChange"
@blur="onNicknameBlur"
/>