halo-sigs / plugin-links

Halo 2.0 的链接管理插件
https://www.halo.run/store/apps/app-hfbQg
GNU General Public License v3.0
30 stars 7 forks source link

要是没有logo的话可以给前端返回一个和后台一样的文字头像吗 #61

Closed Anyexyz closed 3 months ago

Anyexyz commented 5 months ago

链接目前是允许Logo为空的,那么为空的时候可以给前端返回一个和后台一样的文字头像吗

JohnNiang commented 5 months ago

/kind improvement

Anyexyz commented 5 months ago

类似这种接口提供的功能https://ui-avatars.com/api/?name=Hello 在原LOGO加载失败或者没有logo的时候加载

LIlGG commented 3 months ago

后台目前链接为空时并不是一个头像,而是一个文本占位符,取了用户 name 的第一个字符。

https://github.com/halo-dev/halo/blob/ebf1a1fe1b5b9d89eff1404bca1269f9f29b4f30/ui/packages/components/src/components/avatar/Avatar.vue#L86-L99

因此建议主题端自行处理没有用户 logo 的情况。例如放一个默认图,或者采用和 Halo 同样的方式。

ruibaby commented 3 months ago

后台目前链接为空时并不是一个头像,而是一个文本占位符,取了用户 name 的第一个字符。

halo-dev/halo@ebf1a1f/ui/packages/components/src/components/avatar/Avatar.vue#L86-L99

因此建议主题端自行处理没有用户 logo 的情况。例如放一个默认图,或者采用和 Halo 同样的方式。

+1,这应该是前端需要做的事情。

/close

f2c-ci-robot[bot] commented 3 months ago

@ruibaby: Closing this issue.

In response to [this](https://github.com/halo-sigs/plugin-links/issues/61#issuecomment-2166134830): >> 后台目前链接为空时并不是一个头像,而是一个文本占位符,取了用户 name 的第一个字符。 >> >> [halo-dev/halo@`ebf1a1f`/ui/packages/components/src/components/avatar/Avatar.vue#L86-L99](https://github.com/halo-dev/halo/blob/ebf1a1fe1b5b9d89eff1404bca1269f9f29b4f30/ui/packages/components/src/components/avatar/Avatar.vue#L86-L99) >> >> 因此建议主题端自行处理没有用户 logo 的情况。例如放一个默认图,或者采用和 Halo 同样的方式。 > >+1,这应该是前端需要做的事情。 > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.