mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
调整判断逻辑
This commit is contained in:
parent
341ed22370
commit
4c550245db
1 changed files with 1 additions and 1 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue