mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-31 03:43:57 +08:00
调整判断逻辑
This commit is contained in:
@@ -123,7 +123,7 @@ export default {
|
|||||||
this.isSearching = true;
|
this.isSearching = true;
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
// 检测MAC地址格式:包含4个冒号
|
// 检测MAC地址格式:包含4个冒号
|
||||||
const isMac = /(:.*?){4}/.test(keyword);
|
const isMac = /^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$/.test(keyword)
|
||||||
const searchType = isMac ? 'mac' : 'name';
|
const searchType = isMac ? 'mac' : 'name';
|
||||||
Api.agent.searchAgent(keyword, searchType, ({ data }) => {
|
Api.agent.searchAgent(keyword, searchType, ({ data }) => {
|
||||||
if (data?.data) {
|
if (data?.data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user