auth to server-V82

This commit is contained in:
Eric85710 2026-05-11 15:48:21 +08:00
parent cbe0bc58ce
commit 5c4af08bff
2 changed files with 13 additions and 3 deletions

View file

@ -100,7 +100,7 @@ data class UserDetail(
val displayName: String,
@Json(name = "avatar_url")
val avatarUrl: String?,
val SearchAvatarUrl: String?,
@Json(name = "banner_url")
val bannerUrl: String?,
@ -110,4 +110,13 @@ data class UserDetail(
@Json(name = "created_at")
val createdAt: String
)
)
val UserDetail.fullSearchedAvatarUrl: Any
get() = if (SearchAvatarUrl.isNullOrBlank()) {
R.drawable.avatar_v1
} else if (SearchAvatarUrl.startsWith("http")) {
SearchAvatarUrl
} else {
"http://192.168.0.217$SearchAvatarUrl"
}

View file

@ -70,6 +70,7 @@ import com.example.login_v3.data.api.api_class.fullPendingAvatarUrl
import com.example.login_v3.home.Message.ViewModel.Detail.ContactListViewModel
import com.example.login_v3.navigation.BottomBarViewModel
import androidx.compose.ui.text.input.ImeAction
import com.example.login_v3.data.api.api_class.fullSearchedAvatarUrl
@Composable
@ -421,7 +422,7 @@ fun SearchResultRow(
) {
// 這裡放頭像
AsyncImage(
model = user.avatarUrl,
model = user.fullSearchedAvatarUrl,
contentDescription = null,
modifier = Modifier.size(40.dp).clip(CircleShape)
)