update updateFile

master
Aaron Yu 2021-12-24 18:34:07 +08:00
parent 9b0c24d983
commit 8af62b5566
2 changed files with 3 additions and 5 deletions

View File

@ -2,6 +2,7 @@
"name": "playable-preview", "name": "playable-preview",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"homepage": "/preview",
"dependencies": { "dependencies": {
"@emotion/react": "^11.7.1", "@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0", "@emotion/styled": "^11.6.0",

View File

@ -53,13 +53,10 @@ class App extends React.Component {
UpdateSetting(obj) { UpdateSetting(obj) {
var body = { var body = {
...obj, ...obj,
Name: this.state.selectedProject.Name, fileName: this.state.selectedProject.Name,
}; };
var query = Object.keys(body).map(k => `${k}=${body[k]}`).join('&') var query = Object.keys(body).map(k => `${k}=${body[k]}`).join('&')
fetch(`http://123.56.161.61:1157/home/UpdateFileContentNew`, { fetch(`http://123.56.161.61:1157/home/UpdateFileContentNew?${query}`)
method: 'POST',
body: JSON.stringify(body)
})
.then(() => .then(() =>
console.log('update success') console.log('update success')
) )