Fix Framework
This commit is contained in:
parent
f354c987a9
commit
6cf98140ff
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -4,3 +4,6 @@
|
|||
[submodule "MySQLWrapper"]
|
||||
path = MySQLWrapper
|
||||
url = http://kiritow.com:3000/HCTECH/MySQLWrapper.git
|
||||
[submodule "WinUtil"]
|
||||
path = WinUtil
|
||||
url = http://kiritow.com:3000/Kiritow/WinUtil
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c4392bbb9577687737114f237b0c3af641d75208
|
||||
Subproject commit efbdcd7554942a0999a4f29fc95d79e7c9d3c1f8
|
0
addbook.cpp
Normal file
0
addbook.cpp
Normal file
0
addbooktype.cpp
Normal file
0
addbooktype.cpp
Normal file
0
editbook.cpp
Normal file
0
editbook.cpp
Normal file
0
editbooktype.cpp
Normal file
0
editbooktype.cpp
Normal file
0
explore.cpp
Normal file
0
explore.cpp
Normal file
|
@ -74,32 +74,6 @@ static vector<string> splitMultiSQL(const string& multisql)
|
|||
return vec;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void _do_make_str(ostringstream& ostr,T&& x)
|
||||
{
|
||||
ostr<<x;
|
||||
}
|
||||
|
||||
void _do_make_str(ostringstream& ostr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template<typename T,typename... Args>
|
||||
void _do_make_str(ostringstream& ostr,T&& x,Args&&... args)
|
||||
{
|
||||
ostr<<x;
|
||||
_do_make_str(ostr,args...);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
string make_str(Args&&... args)
|
||||
{
|
||||
ostringstream ostr;
|
||||
_do_make_str(ostr,args...);
|
||||
return ostr.str();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
Request req;
|
||||
|
@ -119,13 +93,11 @@ int main()
|
|||
!req.post["dbuser"].empty() &&
|
||||
!req.post["dbpass"].empty() &&
|
||||
!req.post["dbname"].empty() &&
|
||||
!req.post["tbprefix"].empty() &&
|
||||
!req.post["supass"].empty())
|
||||
{
|
||||
string s=getFileContent("setup.sql");
|
||||
replaceFlag(s,"{prefix}",req.post["tbprefix"]);
|
||||
vector<string> vec=splitMultiSQL(s);
|
||||
vec.push_back(make_str("insert into ",req.post["tbprefix"],"_user values ('root','",req.post["supass"],"','SuperUser',0,3) "));
|
||||
vec.push_back(make_str("insert into bs_user values ('root','",req.post["supass"],"','SuperUser',0,3) "));
|
||||
int ecode;
|
||||
string emsg;
|
||||
int ret=doInstall(req.post["dbaddr"],req.post["dbuser"],req.post["dbpass"],req.post["dbname"],ParseInt(req.post["dbport"]),vec,
|
||||
|
@ -140,6 +112,7 @@ int main()
|
|||
else
|
||||
{
|
||||
j["success"]=1;
|
||||
WriteDBConfig(req.post["dbaddr"],req.post["dbuser"],req.post["dbpass"],req.post["dbname"],ParseInt(req.post["dbport"]));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -149,6 +122,12 @@ int main()
|
|||
j["errmsg"]=make_str("Failed to parse parameters. Please retry.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
j["success"]=0;
|
||||
j["errcode"]=3;
|
||||
j["errmsg"]=make_str("Unknown request method.");
|
||||
}
|
||||
res.content.append(j.dump());
|
||||
|
||||
res.show();
|
||||
|
|
0
register.cpp
Normal file
0
register.cpp
Normal file
0
removebook.cpp
Normal file
0
removebook.cpp
Normal file
0
removebooktype.cpp
Normal file
0
removebooktype.cpp
Normal file
0
search.cpp
Normal file
0
search.cpp
Normal file
Reference in New Issue
Block a user