diff --git a/client/.eslintcache b/client/.eslintcache index 5ab321109a7a6009267373fa0c34317d6b9d9eda..59969ea2134f7298c89ccd05abc492f325f85d3c 100644 --- a/client/.eslintcache +++ b/client/.eslintcache @@ -1 +1 @@ -[{"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\index.js":"1","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\App.js":"2","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\reportWebVitals.js":"3","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Home.js":"4","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Login.js":"5","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Signup.js":"6","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Menu.js":"7","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Header.js":"8","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Info.js":"9","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Join.js":"10","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Match.js":"11","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\JList.js":"12","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\MList.js":"13","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\request.js":"14","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\InList.js":"15"},{"size":500,"mtime":499162500000,"results":"16","hashOfConfig":"17"},{"size":986,"mtime":1607731725247,"results":"18","hashOfConfig":"17"},{"size":362,"mtime":499162500000,"results":"19","hashOfConfig":"17"},{"size":306,"mtime":1607357448211,"results":"20","hashOfConfig":"17"},{"size":3248,"mtime":1607769232317,"results":"21","hashOfConfig":"17"},{"size":5080,"mtime":1607719645143,"results":"22","hashOfConfig":"17"},{"size":1049,"mtime":1607402199570,"results":"23","hashOfConfig":"17"},{"size":2996,"mtime":1607768749803,"results":"24","hashOfConfig":"17"},{"size":3511,"mtime":1607799946840,"results":"25","hashOfConfig":"17"},{"size":3294,"mtime":1607795949257,"results":"26","hashOfConfig":"17"},{"size":3275,"mtime":1607796749429,"results":"27","hashOfConfig":"17"},{"size":3637,"mtime":1607796915927,"results":"28","hashOfConfig":"17"},{"size":3621,"mtime":1607796975146,"results":"29","hashOfConfig":"17"},{"size":2305,"mtime":1607728004747,"results":"30","hashOfConfig":"17"},{"size":3482,"mtime":1607799948779,"results":"31","hashOfConfig":"17"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},"acqgsi",{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"51","messages":"52","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"53","usedDeprecatedRules":"34"},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"58","usedDeprecatedRules":"34"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"61","usedDeprecatedRules":"34"},{"filePath":"62","messages":"63","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"64","usedDeprecatedRules":"34"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\index.js",[],["67","68"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\App.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\reportWebVitals.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Home.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Login.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Signup.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Menu.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Header.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Info.js",["69","70","71","72","73"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Join.js",["74"],"import React from 'react'\r\nimport JList from './JList'\r\nimport request from '../request'\r\nimport { withRouter, Redirect } from \"react-router-dom\";\r\n\r\nclass Join extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = { \r\n click: false,\r\n check: false,\r\n title: \"\",\r\n description: \"\",\r\n }\r\n this.Submit = this.Submit.bind(this);\r\n }\r\n Makefile = e => {\r\n this.setState({\r\n click: true\r\n });\r\n }\r\n Goback = e => {\r\n this.setState({\r\n click: false\r\n });\r\n }\r\n handleTitle = e => {\r\n this.setState({\r\n title: e.target.value\r\n })\r\n }\r\n handleDes = e => {\r\n this.setState({\r\n description: e.target.value\r\n })\r\n }\r\n Submit = event => {\r\n event.preventDefault();\r\n this.Goback();\r\n \r\n const data = ({\r\n title: this.state.title,\r\n description: this.state.description\r\n });\r\n \r\n request.joinList(data).then(result => {\r\n this.props.history.push('/join');\r\n }); \r\n }\r\n render() {\r\n if(this.state.click === false){\r\n return(\r\n <div className=\"Group\">\r\n <button type=\"button\" onClick={this.Makefile} className=\"Groupbut\">new</button>\r\n <JList></JList>\r\n </div>\r\n )\r\n } else {\r\n return (\r\n <div>\r\n <div className=\"form_container\">\r\n \r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">title</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" onChange={this.handleTitle} className=\"form_input\" placeholder=\"Input Title\" ></input>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">description</p>\r\n </div>\r\n <div>\r\n <textarea className=\"form_input\" cols='10' rows='10'placeholder=\"Input Description\" onChange={this.handleDes}></textarea>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" onClick={this.Submit} className=\"form_submit_button\">save</button>\r\n <button type=\"button\" onClick={this.Goback} className=\"form_cancel_button\">back</button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n }\r\n }\r\n}\r\n\r\nexport default withRouter(Join)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Match.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\JList.js",["75","76","77"],"import React from 'react'\r\nimport request from '../request'\r\nimport { withRouter, Redirect } from 'react-router-dom'\r\n\r\nclass JList extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n Lists: [],\r\n click: false,\r\n content : \"\",\r\n title: \"\"\r\n }\r\n }\r\n showDes = e => {\r\n this.setState({\r\n click: true\r\n })\r\n this.state.Lists.map(list => {\r\n if(list.title === e.target.innerText) {\r\n this.setState({\r\n content: list.description,\r\n title: list.title\r\n })\r\n }\r\n })\r\n }\r\n Goback = e => {\r\n this.setState({\r\n click: false\r\n });\r\n this.props.history.push('/join');\r\n }\r\n shouldComponentUpdate() {\r\n return true;\r\n }\r\n componentDidMount() { \r\n request.getJoinList().then().then(data => {\r\n this.setState({\r\n Lists: data\r\n })\r\n });\r\n }\r\n render() {\r\n const format = [];\r\n const number = []\r\n if(this.state.Lists.length > 0){\r\n this.state.Lists.map(list => {\r\n number.push(1);\r\n format.push(<tr></tr>)\r\n format.push(<td>{number.length}</td>)\r\n format.push(<td onClick={this.showDes}>{list.title}</td>)\r\n });\r\n }\r\n \r\n if(this.state.click === true) {\r\n return(\r\n <div>\r\n <div className=\"form_container\">\r\n <div className=\"form_title_div\">\r\n <p className=\"form_title_p\">게시물</p>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">title</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" className=\"form_input\" value={this.state.title}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">Content</p>\r\n </div>\r\n <div>\r\n <textarea className=\"form_input\" value={this.state.content}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_password\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.Goback}>Back</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n ) \r\n } else {\r\n return(\r\n <div className=\"showList\">\r\n <table>\r\n <tr>\r\n <th>Index</th>\r\n <th>Title</th>\r\n </tr>\r\n {format}\r\n </table>\r\n </div> \r\n ) \r\n } \r\n }\r\n}\r\n\r\nexport default withRouter(JList)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\MList.js",["78","79"],"import React from 'react'\r\nimport request from '../request'\r\nimport { withRouter } from 'react-router-dom'\r\n\r\nclass MList extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n Lists: [],\r\n click: false,\r\n content : \"\",\r\n title: \"\"\r\n }\r\n }\r\n showDes = e => {\r\n this.setState({\r\n click: true\r\n })\r\n this.state.Lists.map(list => {\r\n if(list.title === e.target.innerText) {\r\n this.setState({\r\n content: list.description,\r\n title: list.title\r\n })\r\n }\r\n })\r\n }\r\n Goback = e => {\r\n this.setState({\r\n click: false\r\n });\r\n this.props.history.push('/match');\r\n }\r\n shouldComponentUpdate() {\r\n return true \r\n }\r\n componentDidMount() { \r\n request.getMatchList().then().then(data => {\r\n this.setState({\r\n Lists: data\r\n })\r\n });\r\n }\r\n render() {\r\n const format = [];\r\n const number = []\r\n if(this.state.Lists.length > 0) {\r\n this.state.Lists.map(list => {\r\n number.push(1);\r\n format.push(<tr></tr>)\r\n format.push(<td>{number.length}</td>)\r\n format.push(<td onClick={this.showDes}>{list.title}</td>)\r\n });\r\n }\r\n if(this.state.click === true) {\r\n return(\r\n <div>\r\n <div className=\"form_container\">\r\n <div className=\"form_title_div\">\r\n <p className=\"form_title_p\">게시물</p>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">title</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" className=\"form_input\" value={this.state.title}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">Content</p>\r\n </div>\r\n <div>\r\n <textarea className=\"form_input\" value={this.state.content}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_password\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.Goback}>Back</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n ) \r\n } else {\r\n return(\r\n <div className=\"showList\">\r\n <table>\r\n <tr>\r\n <th>Index</th>\r\n <th>Title</th>\r\n </tr>\r\n {format}\r\n </table>\r\n </div> \r\n ) \r\n } \r\n }\r\n}\r\n\r\nexport default withRouter(MList)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\request.js",["80"],"import axios from 'axios';\r\n\r\nconst API_DEFAULT = \"http://localhost:3001/\";\r\nconst instance = axios.create({ baseURL: API_DEFAULT });\r\n\r\nexport async function getUser() {\r\n const result = await instance.get('/');\r\n console.log(result)\r\n return result.data\r\n}\r\n\r\nexport async function dropUser() {\r\n const result = await instance.get('/logout');\r\n return result.data\r\n}\r\n\r\n// export async function searchUser(email) {\r\n// const result = await instance.get('/login' + email);\r\n// return result.data\r\n// }\r\n\r\nexport async function putUser({username, email, password}) {\r\n const result = await instance.post('/routes/save', {\r\n username: username,\r\n email: email, \r\n password: password \r\n });\r\n console.log(result);\r\n return result.data\r\n}\r\n\r\nexport async function checkUser({email, password}) {\r\n const result = await instance.post('/routes/login', {\r\n email: email, \r\n password: password \r\n });\r\n console.log(result);\r\n return result.data\r\n}\r\n\r\nexport async function joinList({title, description}) {\r\n const result = await instance.post('/routes/join', {\r\n title: title,\r\n description: description\r\n });\r\n return result.data\r\n}\r\n\r\nexport async function matchList({title, description}) {\r\n const result = await instance.post('/routes/match', {\r\n title: title,\r\n description: description\r\n });\r\n return result.data\r\n}\r\n\r\nexport async function infoList({name, time, location}) {\r\n const result = await instance.post('/routes/info', {\r\n name: name,\r\n time: time,\r\n location: location\r\n });\r\n console.log(result.data)\r\n return result.data\r\n}\r\n\r\nexport async function getJoinList() {\r\n const result = await instance.get('/routes/join/return');\r\n return result.data;\r\n}\r\n\r\nexport async function getMatchList() {\r\n const result = await instance.get('/routes/match/return');\r\n return result.data;\r\n}\r\n\r\nexport async function getInfoList() {\r\n const result = await instance.get('/routes/info/return');\r\n return result.data;\r\n}\r\n\r\nexport default {\r\n getUser,\r\n dropUser,\r\n putUser,\r\n checkUser,\r\n // searchUser,\r\n joinList,\r\n matchList,\r\n getJoinList,\r\n getMatchList,\r\n infoList,\r\n getInfoList\r\n}\r\n\r\n\r\n\r\n\r\n","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\InList.js",[],{"ruleId":"81","replacedBy":"82"},{"ruleId":"83","replacedBy":"84"},{"ruleId":"85","severity":1,"message":"86","line":4,"column":10,"nodeType":"87","messageId":"88","endLine":4,"endColumn":23},{"ruleId":"85","severity":1,"message":"89","line":4,"column":37,"nodeType":"87","messageId":"88","endLine":4,"endColumn":43},{"ruleId":"85","severity":1,"message":"90","line":4,"column":45,"nodeType":"87","messageId":"88","endLine":4,"endColumn":50},{"ruleId":"85","severity":1,"message":"91","line":4,"column":52,"nodeType":"87","messageId":"88","endLine":4,"endColumn":56},{"ruleId":"92","severity":1,"message":"93","line":85,"column":39,"nodeType":"94","messageId":"95","endLine":85,"endColumn":41},{"ruleId":"85","severity":1,"message":"96","line":4,"column":22,"nodeType":"87","messageId":"88","endLine":4,"endColumn":30},{"ruleId":"85","severity":1,"message":"96","line":3,"column":22,"nodeType":"87","messageId":"88","endLine":3,"endColumn":30},{"ruleId":"92","severity":1,"message":"93","line":19,"column":35,"nodeType":"94","messageId":"95","endLine":19,"endColumn":37},{"ruleId":"92","severity":1,"message":"93","line":48,"column":39,"nodeType":"94","messageId":"95","endLine":48,"endColumn":41},{"ruleId":"92","severity":1,"message":"93","line":19,"column":35,"nodeType":"94","messageId":"95","endLine":19,"endColumn":37},{"ruleId":"92","severity":1,"message":"93","line":48,"column":39,"nodeType":"94","messageId":"95","endLine":48,"endColumn":41},{"ruleId":"97","severity":1,"message":"98","line":82,"column":1,"nodeType":"99","endLine":94,"endColumn":2},"no-native-reassign",["100"],"no-negated-in-lhs",["101"],"no-unused-vars","'BrowserRouter' is defined but never used.","Identifier","unusedVar","'Switch' is defined but never used.","'Route' is defined but never used.","'Link' is defined but never used.","array-callback-return","Array.prototype.map() expects a return value from arrow function.","ArrowFunctionExpression","expectedInside","'Redirect' is defined but never used.","import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","no-global-assign","no-unsafe-negation"] \ No newline at end of file +[{"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\index.js":"1","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\App.js":"2","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\reportWebVitals.js":"3","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Home.js":"4","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Login.js":"5","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Signup.js":"6","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Menu.js":"7","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Header.js":"8","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Info.js":"9","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Join.js":"10","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Match.js":"11","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\JList.js":"12","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\MList.js":"13","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\request.js":"14","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\InList.js":"15"},{"size":500,"mtime":499162500000,"results":"16","hashOfConfig":"17"},{"size":986,"mtime":1607731725247,"results":"18","hashOfConfig":"17"},{"size":362,"mtime":499162500000,"results":"19","hashOfConfig":"17"},{"size":306,"mtime":1607357448211,"results":"20","hashOfConfig":"17"},{"size":3498,"mtime":1607801466370,"results":"21","hashOfConfig":"17"},{"size":5315,"mtime":1607801870907,"results":"22","hashOfConfig":"17"},{"size":1049,"mtime":1607402199570,"results":"23","hashOfConfig":"17"},{"size":2996,"mtime":1607768749803,"results":"24","hashOfConfig":"17"},{"size":3511,"mtime":1607799946840,"results":"25","hashOfConfig":"17"},{"size":3294,"mtime":1607795949257,"results":"26","hashOfConfig":"17"},{"size":3275,"mtime":1607796749429,"results":"27","hashOfConfig":"17"},{"size":3637,"mtime":1607796915927,"results":"28","hashOfConfig":"17"},{"size":3621,"mtime":1607796975146,"results":"29","hashOfConfig":"17"},{"size":2305,"mtime":1607728004747,"results":"30","hashOfConfig":"17"},{"size":3482,"mtime":1607799948779,"results":"31","hashOfConfig":"17"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},"acqgsi",{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"43","usedDeprecatedRules":"34"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"50","messages":"51","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"52","usedDeprecatedRules":"34"},{"filePath":"53","messages":"54","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"55","usedDeprecatedRules":"34"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"60","usedDeprecatedRules":"34"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"63","usedDeprecatedRules":"34"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"66","usedDeprecatedRules":"34"},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\index.js",[],["69","70"],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\App.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\reportWebVitals.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Home.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Login.js",["71"],"import React from 'react'\r\nimport request from '../request'\r\nimport { withRouter } from 'react-router-dom';\r\n\r\nclass Login extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n email: \"\",\r\n password: \"\"\r\n }\r\n }\r\n email_value = (e) => {\r\n this.setState ({\r\n email: e.target.value\r\n });\r\n }\r\n pw_value = (e) => {\r\n this.setState({\r\n password: e.target.value\r\n });\r\n }\r\n handleSubmit= event => {\r\n event.preventDefault();\r\n \r\n const data = ({\r\n email: this.state.email,\r\n password: this.state.password\r\n })\r\n request.checkUser(data).then(result => {\r\n console.log(result);\r\n if(result.result == \"fail\") {\r\n alert(\"Wrong Input\");\r\n this.props.history.push('/login');\r\n }\r\n else {\r\n this.setState({\r\n email: result.email,\r\n password: result.password\r\n });\r\n sessionStorage.setItem(\"is_authen\", true);\r\n sessionStorage.setItem(\"username\", result.username);\r\n this.props.getName();\r\n this.props.history.push('/menu');\r\n }\r\n })\r\n \r\n }\r\n render() {\r\n return(\r\n <div id=\"container\" className=\"main_container\">\r\n <div className=\"login_container\">\r\n <form className=\"form_container\">\r\n <div className=\"form_container\">\r\n <div className=\"form_title_div\">\r\n <p className=\"form_title_p\">Member Login</p>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">email</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" placeholder=\"email\" className=\"form_input\" onChange={this.email_value}></input>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">Password</p>\r\n </div>\r\n <div>\r\n <input type=\"password\" placeholder=\"Enter password\" className=\"form_input\" onChange={this.pw_value}></input>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_password\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <input type=\"submit\" className=\"form_submit_button\" value=\"Submit\" onClick={this.handleSubmit.bind(this)}></input>\r\n </div>\r\n </div>\r\n </form> \r\n </div>\r\n </div>\r\n )\r\n }\r\n}\r\n\r\nexport default withRouter(Login)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Signup.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Menu.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Header.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Info.js",["72","73","74","75","76"],"import React from 'react'\r\nimport InList from './InList'\r\nimport request from '../request'\r\nimport { BrowserRouter, withRouter, Switch, Route, Link } from 'react-router-dom'\r\n\r\nclass Info extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n click: false,\r\n update: false,\r\n location: \"\",\r\n Lists: []\r\n }\r\n this.returnsearch = this.returnsearch.bind(this)\r\n }\r\n detect = event => {\r\n this.setState({\r\n location: event.target.value\r\n })\r\n }\r\n showList = event => {\r\n event.preventDefault();\r\n request.getInfoList().then().then(datas => {\r\n if(datas.length > 0) {\r\n const result = datas.filter(data => data.location === this.state.location)\r\n this.setState({\r\n Lists: result,\r\n click: true\r\n })\r\n }\r\n });\r\n }\r\n goBack = event => {\r\n event.preventDefault();\r\n this.setState({\r\n click: false\r\n })\r\n }\r\n returnsearch() {\r\n this.setState({\r\n update: false\r\n });\r\n }\r\n onUpate = event => {\r\n event.preventDefault();\r\n this.setState({\r\n update: true\r\n })\r\n }\r\n render() {\r\n if(this.state.update === true) {\r\n return(\r\n <InList return={this.returnsearch}></InList>\r\n )\r\n }\r\n if(this.state.click === false) {\r\n return(\r\n <div className=\"form_container\">\r\n <div className=\"searchLocation\">\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n <div>\r\n <p className=\"form_item_name\">search</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" className=\"form_input\" onChange={this.detect}></input>\r\n </div>\r\n \r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n <button type=\"button\" onClick={this.showList} className=\"form_submit_button\">Search</button>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.onUpate.bind(this)}>New</button>\r\n \r\n </div>\r\n </div>\r\n )\r\n } else {\r\n const filter_list = [];\r\n this.state.Lists.map(list => {\r\n filter_list.push(<li>{list.time} {list.name}</li>)\r\n })\r\n return(\r\n <div className=\"form_container\">\r\n <p>경기장 리스트</p>\r\n <ul>\r\n {filter_list}\r\n </ul> \r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.goBack}>Back</button>\r\n </div> \r\n )\r\n }\r\n }\r\n}\r\n\r\nexport default withRouter(Info)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Join.js",["77"],"import React from 'react'\r\nimport JList from './JList'\r\nimport request from '../request'\r\nimport { withRouter, Redirect } from \"react-router-dom\";\r\n\r\nclass Join extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = { \r\n click: false,\r\n check: false,\r\n title: \"\",\r\n description: \"\",\r\n }\r\n this.Submit = this.Submit.bind(this);\r\n }\r\n Makefile = e => {\r\n this.setState({\r\n click: true\r\n });\r\n }\r\n Goback = e => {\r\n this.setState({\r\n click: false\r\n });\r\n }\r\n handleTitle = e => {\r\n this.setState({\r\n title: e.target.value\r\n })\r\n }\r\n handleDes = e => {\r\n this.setState({\r\n description: e.target.value\r\n })\r\n }\r\n Submit = event => {\r\n event.preventDefault();\r\n this.Goback();\r\n \r\n const data = ({\r\n title: this.state.title,\r\n description: this.state.description\r\n });\r\n \r\n request.joinList(data).then(result => {\r\n this.props.history.push('/join');\r\n }); \r\n }\r\n render() {\r\n if(this.state.click === false){\r\n return(\r\n <div className=\"Group\">\r\n <button type=\"button\" onClick={this.Makefile} className=\"Groupbut\">new</button>\r\n <JList></JList>\r\n </div>\r\n )\r\n } else {\r\n return (\r\n <div>\r\n <div className=\"form_container\">\r\n \r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">title</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" onChange={this.handleTitle} className=\"form_input\" placeholder=\"Input Title\" ></input>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">description</p>\r\n </div>\r\n <div>\r\n <textarea className=\"form_input\" cols='10' rows='10'placeholder=\"Input Description\" onChange={this.handleDes}></textarea>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" onClick={this.Submit} className=\"form_submit_button\">save</button>\r\n <button type=\"button\" onClick={this.Goback} className=\"form_cancel_button\">back</button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n }\r\n }\r\n}\r\n\r\nexport default withRouter(Join)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\Match.js",[],"C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\JList.js",["78","79","80"],"import React from 'react'\r\nimport request from '../request'\r\nimport { withRouter, Redirect } from 'react-router-dom'\r\n\r\nclass JList extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n Lists: [],\r\n click: false,\r\n content : \"\",\r\n title: \"\"\r\n }\r\n }\r\n showDes = e => {\r\n this.setState({\r\n click: true\r\n })\r\n this.state.Lists.map(list => {\r\n if(list.title === e.target.innerText) {\r\n this.setState({\r\n content: list.description,\r\n title: list.title\r\n })\r\n }\r\n })\r\n }\r\n Goback = e => {\r\n this.setState({\r\n click: false\r\n });\r\n this.props.history.push('/join');\r\n }\r\n shouldComponentUpdate() {\r\n return true;\r\n }\r\n componentDidMount() { \r\n request.getJoinList().then().then(data => {\r\n this.setState({\r\n Lists: data\r\n })\r\n });\r\n }\r\n render() {\r\n const format = [];\r\n const number = []\r\n if(this.state.Lists.length > 0){\r\n this.state.Lists.map(list => {\r\n number.push(1);\r\n format.push(<tr></tr>)\r\n format.push(<td>{number.length}</td>)\r\n format.push(<td onClick={this.showDes}>{list.title}</td>)\r\n });\r\n }\r\n \r\n if(this.state.click === true) {\r\n return(\r\n <div>\r\n <div className=\"form_container\">\r\n <div className=\"form_title_div\">\r\n <p className=\"form_title_p\">게시물</p>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">title</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" className=\"form_input\" value={this.state.title}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">Content</p>\r\n </div>\r\n <div>\r\n <textarea className=\"form_input\" value={this.state.content}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_password\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.Goback}>Back</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n ) \r\n } else {\r\n return(\r\n <div className=\"showList\">\r\n <table>\r\n <tr>\r\n <th>Index</th>\r\n <th>Title</th>\r\n </tr>\r\n {format}\r\n </table>\r\n </div> \r\n ) \r\n } \r\n }\r\n}\r\n\r\nexport default withRouter(JList)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\MList.js",["81","82"],"import React from 'react'\r\nimport request from '../request'\r\nimport { withRouter } from 'react-router-dom'\r\n\r\nclass MList extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n Lists: [],\r\n click: false,\r\n content : \"\",\r\n title: \"\"\r\n }\r\n }\r\n showDes = e => {\r\n this.setState({\r\n click: true\r\n })\r\n this.state.Lists.map(list => {\r\n if(list.title === e.target.innerText) {\r\n this.setState({\r\n content: list.description,\r\n title: list.title\r\n })\r\n }\r\n })\r\n }\r\n Goback = e => {\r\n this.setState({\r\n click: false\r\n });\r\n this.props.history.push('/match');\r\n }\r\n shouldComponentUpdate() {\r\n return true \r\n }\r\n componentDidMount() { \r\n request.getMatchList().then().then(data => {\r\n this.setState({\r\n Lists: data\r\n })\r\n });\r\n }\r\n render() {\r\n const format = [];\r\n const number = []\r\n if(this.state.Lists.length > 0) {\r\n this.state.Lists.map(list => {\r\n number.push(1);\r\n format.push(<tr></tr>)\r\n format.push(<td>{number.length}</td>)\r\n format.push(<td onClick={this.showDes}>{list.title}</td>)\r\n });\r\n }\r\n if(this.state.click === true) {\r\n return(\r\n <div>\r\n <div className=\"form_container\">\r\n <div className=\"form_title_div\">\r\n <p className=\"form_title_p\">게시물</p>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">title</p>\r\n </div>\r\n <div>\r\n <input type=\"text\" className=\"form_input\" value={this.state.title}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_username\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <div>\r\n <p className=\"form_item_name\">Content</p>\r\n </div>\r\n <div>\r\n <textarea className=\"form_input\" value={this.state.content}/>\r\n </div>\r\n <div className=\"form_text_alert_padding\">\r\n <div id=\"alert_password\" className=\"form_text_alert\"></div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"button\" className=\"form_submit_button\" onClick={this.Goback}>Back</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n ) \r\n } else {\r\n return(\r\n <div className=\"showList\">\r\n <table>\r\n <tr>\r\n <th>Index</th>\r\n <th>Title</th>\r\n </tr>\r\n {format}\r\n </table>\r\n </div> \r\n ) \r\n } \r\n }\r\n}\r\n\r\nexport default withRouter(MList)","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\request.js",["83"],"import axios from 'axios';\r\n\r\nconst API_DEFAULT = \"http://localhost:3001/\";\r\nconst instance = axios.create({ baseURL: API_DEFAULT });\r\n\r\nexport async function getUser() {\r\n const result = await instance.get('/');\r\n console.log(result)\r\n return result.data\r\n}\r\n\r\nexport async function dropUser() {\r\n const result = await instance.get('/logout');\r\n return result.data\r\n}\r\n\r\n// export async function searchUser(email) {\r\n// const result = await instance.get('/login' + email);\r\n// return result.data\r\n// }\r\n\r\nexport async function putUser({username, email, password}) {\r\n const result = await instance.post('/routes/save', {\r\n username: username,\r\n email: email, \r\n password: password \r\n });\r\n console.log(result);\r\n return result.data\r\n}\r\n\r\nexport async function checkUser({email, password}) {\r\n const result = await instance.post('/routes/login', {\r\n email: email, \r\n password: password \r\n });\r\n console.log(result);\r\n return result.data\r\n}\r\n\r\nexport async function joinList({title, description}) {\r\n const result = await instance.post('/routes/join', {\r\n title: title,\r\n description: description\r\n });\r\n return result.data\r\n}\r\n\r\nexport async function matchList({title, description}) {\r\n const result = await instance.post('/routes/match', {\r\n title: title,\r\n description: description\r\n });\r\n return result.data\r\n}\r\n\r\nexport async function infoList({name, time, location}) {\r\n const result = await instance.post('/routes/info', {\r\n name: name,\r\n time: time,\r\n location: location\r\n });\r\n console.log(result.data)\r\n return result.data\r\n}\r\n\r\nexport async function getJoinList() {\r\n const result = await instance.get('/routes/join/return');\r\n return result.data;\r\n}\r\n\r\nexport async function getMatchList() {\r\n const result = await instance.get('/routes/match/return');\r\n return result.data;\r\n}\r\n\r\nexport async function getInfoList() {\r\n const result = await instance.get('/routes/info/return');\r\n return result.data;\r\n}\r\n\r\nexport default {\r\n getUser,\r\n dropUser,\r\n putUser,\r\n checkUser,\r\n // searchUser,\r\n joinList,\r\n matchList,\r\n getJoinList,\r\n getMatchList,\r\n infoList,\r\n getInfoList\r\n}\r\n\r\n\r\n\r\n\r\n","C:\\Users\\82106\\Desktop\\Final_project\\web-project\\client\\src\\components\\InList.js",[],{"ruleId":"84","replacedBy":"85"},{"ruleId":"86","replacedBy":"87"},{"ruleId":"88","severity":1,"message":"89","line":32,"column":30,"nodeType":"90","messageId":"91","endLine":32,"endColumn":32},{"ruleId":"92","severity":1,"message":"93","line":4,"column":10,"nodeType":"94","messageId":"95","endLine":4,"endColumn":23},{"ruleId":"92","severity":1,"message":"96","line":4,"column":37,"nodeType":"94","messageId":"95","endLine":4,"endColumn":43},{"ruleId":"92","severity":1,"message":"97","line":4,"column":45,"nodeType":"94","messageId":"95","endLine":4,"endColumn":50},{"ruleId":"92","severity":1,"message":"98","line":4,"column":52,"nodeType":"94","messageId":"95","endLine":4,"endColumn":56},{"ruleId":"99","severity":1,"message":"100","line":85,"column":39,"nodeType":"101","messageId":"102","endLine":85,"endColumn":41},{"ruleId":"92","severity":1,"message":"103","line":4,"column":22,"nodeType":"94","messageId":"95","endLine":4,"endColumn":30},{"ruleId":"92","severity":1,"message":"103","line":3,"column":22,"nodeType":"94","messageId":"95","endLine":3,"endColumn":30},{"ruleId":"99","severity":1,"message":"100","line":19,"column":35,"nodeType":"101","messageId":"102","endLine":19,"endColumn":37},{"ruleId":"99","severity":1,"message":"100","line":48,"column":39,"nodeType":"101","messageId":"102","endLine":48,"endColumn":41},{"ruleId":"99","severity":1,"message":"100","line":19,"column":35,"nodeType":"101","messageId":"102","endLine":19,"endColumn":37},{"ruleId":"99","severity":1,"message":"100","line":48,"column":39,"nodeType":"101","messageId":"102","endLine":48,"endColumn":41},{"ruleId":"104","severity":1,"message":"105","line":82,"column":1,"nodeType":"106","endLine":94,"endColumn":2},"no-native-reassign",["107"],"no-negated-in-lhs",["108"],"eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","no-unused-vars","'BrowserRouter' is defined but never used.","Identifier","unusedVar","'Switch' is defined but never used.","'Route' is defined but never used.","'Link' is defined but never used.","array-callback-return","Array.prototype.map() expects a return value from arrow function.","ArrowFunctionExpression","expectedInside","'Redirect' is defined but never used.","import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","no-global-assign","no-unsafe-negation"] \ No newline at end of file diff --git a/client/src/components/Login.js b/client/src/components/Login.js index 64969745448ed1097e692fd58ece415ecfbdf784..2c185b4e54d3be37c20704e2ea20083353c31eed 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -28,14 +28,21 @@ class Login extends React.Component { password: this.state.password }) request.checkUser(data).then(result => { - this.setState({ - email: result.email, - password: result.password - }); - sessionStorage.setItem("is_authen", true); - sessionStorage.setItem("username", result.username); - this.props.getName(); - this.props.history.push('/menu'); + console.log(result); + if(result.result == "fail") { + alert("Wrong Input"); + this.props.history.push('/login'); + } + else { + this.setState({ + email: result.email, + password: result.password + }); + sessionStorage.setItem("is_authen", true); + sessionStorage.setItem("username", result.username); + this.props.getName(); + this.props.history.push('/menu'); + } }) } diff --git a/client/src/components/Signup.js b/client/src/components/Signup.js index d258012c652c481a45b5f76cfa896a8f080bf85c..c5f39105bcb65f49c32c105b7339b7bae12b67d7 100644 --- a/client/src/components/Signup.js +++ b/client/src/components/Signup.js @@ -35,15 +35,22 @@ class Signup extends React.Component { }) request.putUser(data).then(result => { - this.setState({ - username: result.username, - email: result.email, - password: result.password - }); - sessionStorage.setItem("is_authen", true); - sessionStorage.setItem("username", result.username); - this.props.getName(); - this.props.history.push('/menu'); + if(result.result === "fail") { + alert("Wrong Input"); + this.props.history.push('/signup'); + } + else{ + this.setState({ + username: result.username, + email: result.email, + password: result.password + }); + sessionStorage.setItem("is_authen", true); + sessionStorage.setItem("username", result.username); + this.props.getName(); + this.props.history.push('/menu'); + } + }) } render() { diff --git a/server/routes/login.js b/server/routes/login.js index b0fd80daed52da6339134c94ef559b8f11ed7a96..a24ca7ab87e96dc4ebf9c4db0c143758e6e73295 100644 --- a/server/routes/login.js +++ b/server/routes/login.js @@ -1,6 +1,5 @@ const User = require('../models/user'); var express = require('express'); -const { db } = require('../models/user'); var router = express.Router(); router.get('/', function(req, res, next) { @@ -28,7 +27,11 @@ router.post('/routes/login', function(req, res, next) { req.session.email = result.email; req.session.is_authen = true; res.json(result); - } + } else { + res.json({result: "fail"}); + } + }).catch(err => { + res.json({result: "fail"}); }) }); diff --git a/server/routes/signup.js b/server/routes/signup.js index ee77f258410d99920dca901380bb298667f6fba7..ac4cb6eab20d915750c4e6e759508198a3d404a3 100644 --- a/server/routes/signup.js +++ b/server/routes/signup.js @@ -6,10 +6,11 @@ var router = express.Router(); router.post('/routes/save', function(req, res, next) { console.log(req.body); User.findOne({email: req.body.email}, function(err, data) { + console.log(data); if(err) - console.log(err) + console.log(err); else { - if(data == null) { + if(data === null) { const newData = new User( { username: req.body.username, @@ -28,7 +29,7 @@ router.post('/routes/save', function(req, res, next) { }) res.json(newData); } else { - res.end(`<script>alert("There already have an account"); window.location.replace("http://localhost:3000/signup");</script>`); + res.json({result: "fail"}); } } })