利用字符串的拆分
let method = string.split('?')[0] if (method === 'get') { return data } else if (method === 'update') { let str = string.split('?')[1].split('&')[1].split('=')[1] let name = string.split('?')[1].split('&')[0].split('=')[1] data.forEach(item => { if (item.name === name) { item.name = str } }) return data }