brookshi / Hitchhiker

a Restful Api test tool
http://www.hitchhiker-api.com
Other
2.19k stars 402 forks source link

localhost_mapping数据更新逻辑错误 #222

Open liutf opened 6 years ago

liutf commented 6 years ago

image

 select * from localhost_mapping where userId='c984c660-81f6-11e8-9aac-bf03f0b12be5-BJ8zII0fX' and projectId='2e237b00-8311-11e8-833e-2783d9b1a8bd-HypRJNgX7';

image

userId='c984c660-81f6-11e8-9aac-bf03f0b12be5-BJ8zII0fX' 在项目 projectId='2e237b00-8311-11e8-833e-2783d9b1a8bd-HypRJNgX7' 修改了多次成员的localhost,localhost_mapping 更新数据却变成了多条,导致我在调用{{localhost}}请求时,老是用的是之前配置错的IP。

brookshi commented 6 years ago

应该只是数据没删掉吧,id还是唯一的,这个id才是给project用的

liutf commented 6 years ago

userId和projectId对应的ip只有一条数据才对吧?

我遇到的是对应了3条IP。。

brookshi commented 6 years ago

更新后是为了简单加了一条,没有在原来基础上update,所以旧的还在,没删掉。 当然update一条更合理,只是采用了update时update整个project,对于join的这种localhost_map就增加了一条,有时间需要改进下。