fix modal bug

This commit is contained in:
Jay 2017-05-03 13:10:04 +08:00
parent ef5e115b9d
commit 5113518997

View File

@ -77,7 +77,8 @@ class IPCamPage extends React.Component {
if(!data.model) return showDialog('請選擇型號'); if(!data.model) return showDialog('請選擇型號');
toggleLoading(1); toggleLoading(1);
fetch('/api/ipcam/addipcam', getRequest(data)) let url = type == 1 ? '/api/ipcam/editipcam' : '/api/ipcam/addipcam';
fetch(url, getRequest(data))
.then(response=>response.json()) .then(response=>response.json())
.then(json => { .then(json => {
toggleLoading(0); toggleLoading(0);