优化角色面板提示信息#135

This commit is contained in:
UCPr 2025-07-02 02:17:21 +08:00
parent e9d912f118
commit 80b39c9864
4 changed files with 35 additions and 14 deletions

View file

@ -144,12 +144,12 @@ export const getPanelListOrigin = uid => {
* 获取某个角色的面板数据
* @param {string} uid
* @param {string} name
* @returns {ZZZAvatarInfo | null}
* @returns {ZZZAvatarInfo | null | false}
*/
export const getPanel = (uid, name) => {
// 通过名称(包括别名)获取角色 ID
const id = char.aliasToID(name);
if (!id) return null;
if (!id) return false;
const _data = getPanelData(uid);
// 获取所有面板数据
const data = _data.map(item => new ZZZAvatarInfo(item));
@ -163,11 +163,11 @@ export const getPanel = (uid, name) => {
* 获取某个角色的面板数据原始数据
* @param {string} uid
* @param {string} name
* @returns {ZZZAvatarInfo | null}
* @returns {ZZZAvatarInfo | null | false}
*/
export const getPanelOrigin = (uid, name) => {
const id = char.aliasToID(name);
if (!id) return null;
if (!id) return false;
const data = getPanelData(uid);
// 通过 ID 获取角色数据
const result = data.find(item => item.id === id);