mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat:
This commit is contained in:
parent
8726230a26
commit
e630df98a7
|
|
@ -40,10 +40,15 @@ const getAvatarColour = (name: string) => {
|
|||
'#7F3BF5',
|
||||
'#8F959E'
|
||||
]
|
||||
let charIndex = name ? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65 : 0
|
||||
console.log(pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65)
|
||||
let charIndex = name
|
||||
? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65 > 0
|
||||
? pinyin(name).charAt(0).toUpperCase().charCodeAt(0) - 65
|
||||
: 0
|
||||
: 0
|
||||
|
||||
function getColor() {
|
||||
if (!colours[charIndex]) {
|
||||
if (!colours?.[charIndex]) {
|
||||
charIndex -= 10
|
||||
getColor()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue