更换前端组件库

This commit is contained in:
CaIon
2023-10-31 00:03:22 +08:00
parent 7688e9f9dd
commit e3b7f8bff9
16 changed files with 1212 additions and 1869 deletions

View File

@@ -55,4 +55,21 @@ export function renderQuotaWithPrompt(quota, digits) {
return `(等价金额:${renderQuota(quota, digits)}`;
}
return '';
}
const colors = ['amber', 'blue', 'cyan', 'green', 'grey', 'indigo',
'light-blue', 'lime', 'orange', 'pink',
'purple', 'red', 'teal', 'violet', 'yellow'
]
export function stringToColor(str) {
let sum = 0;
// 对字符串中的每个字符进行操作
for (let i = 0; i < str.length; i++) {
// 将字符的ASCII值加到sum中
sum += str.charCodeAt(i);
}
// 使用模运算得到个位数
let i = sum % colors.length;
return colors[i];
}

View File

@@ -22,7 +22,7 @@ export function isRoot() {
export function getSystemName() {
let system_name = localStorage.getItem('system_name');
if (!system_name) return 'One API Midjourney';
if (!system_name) return 'Neko API';
return system_name;
}