mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-24 19:29:25 +08:00
feat: 增加配置文件
This commit is contained in:
parent
f9a7924658
commit
34eb14edb2
@ -1,6 +1,17 @@
|
||||
#include "config.h"
|
||||
#include "pch.h"
|
||||
#include "config.h"
|
||||
|
||||
namespace wxhelper {
|
||||
Config::Config(/* args */) {}
|
||||
|
||||
Config::~Config() {}
|
||||
|
||||
|
||||
void Config::Initialize(){
|
||||
port_ = GetPrivateProfileInt("config", "Port", 19088, "./config.ini");
|
||||
}
|
||||
int Config::GetPort(){
|
||||
return port_;
|
||||
}
|
||||
|
||||
} // namespace wxhelper
|
12
src/config.h
12
src/config.h
@ -3,13 +3,15 @@
|
||||
|
||||
namespace wxhelper {
|
||||
|
||||
class Config
|
||||
{
|
||||
private:
|
||||
/* data */
|
||||
class Config {
|
||||
public:
|
||||
Config(/* args */);
|
||||
~Config();
|
||||
void Initialize();
|
||||
int GetPort();
|
||||
|
||||
private:
|
||||
int port_;
|
||||
};
|
||||
}
|
||||
} // namespace wxhelper
|
||||
#endif
|
@ -11,14 +11,15 @@ void GlobalContext::initialize(HMODULE module) {
|
||||
module_ = module;
|
||||
DWORD base = Utils::GetWeChatWinBase();
|
||||
config.emplace();
|
||||
config->Initialize();
|
||||
log.emplace();
|
||||
log->initialize();
|
||||
log->Initialize();
|
||||
hide_module.emplace();
|
||||
#ifndef _DEBUG
|
||||
hide_module->Hide(module_);
|
||||
#endif
|
||||
|
||||
HttpServer::GetInstance().Init(19088);
|
||||
HttpServer::GetInstance().Init(config->GetPort());
|
||||
HttpServer::GetInstance().HttpStart();
|
||||
DB::GetInstance().init(base);
|
||||
contact_mgr.emplace(ContactMgr{base});
|
||||
|
@ -7,7 +7,7 @@ Log::Log(/* args */) {}
|
||||
|
||||
Log::~Log() {}
|
||||
|
||||
void Log::initialize() {
|
||||
void Log::Initialize() {
|
||||
|
||||
el::Configurations conf;
|
||||
// 启用日志
|
||||
|
Loading…
Reference in New Issue
Block a user