fix: 图标路径判断问题

This commit is contained in:
streakingman 2022-10-11 22:51:38 +08:00
parent 47caa7ccf9
commit fc7a880607

View File

@ -10,7 +10,6 @@ import {
LAST_LEVEL_STORAGE_KEY, LAST_LEVEL_STORAGE_KEY,
LAST_SCORE_STORAGE_KEY, LAST_SCORE_STORAGE_KEY,
LAST_TIME_STORAGE_KEY, LAST_TIME_STORAGE_KEY,
linkReg,
randomString, randomString,
waitTimeout, waitTimeout,
} from '../utils'; } from '../utils';
@ -133,8 +132,9 @@ const Symbol: FC<SymbolProps> = ({ x, y, icon, isCover, status, onClick }) => {
style={{ opacity: isCover ? 0.4 : 1 }} style={{ opacity: isCover ? 0.4 : 1 }}
> >
{typeof icon.content === 'string' ? ( {typeof icon.content === 'string' ? (
linkReg.test(icon.content) || icon.content.startsWith('data:') ||
icon.content.startsWith('/') ? ( icon.content.startsWith('/') ||
icon.content.startsWith('http') ? (
/*图片地址*/ /*图片地址*/
<img src={icon.content} alt="" /> <img src={icon.content} alt="" />
) : ( ) : (