diff --git a/.gitignore b/.gitignore index 8678948..3733236 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,8 @@ *.idea *cmake-build-debug + ToTpAuth/src/main.cpp +*.vs +out + diff --git a/ToTpAuth/README.md b/ToTpAuth/README.md index 928bc5e..93d81e4 100644 --- a/ToTpAuth/README.md +++ b/ToTpAuth/README.md @@ -6,16 +6,10 @@ gcc >= 8.1 ``` ### 构建项目 && 运行 ```shell -# 创建构建目录 -mkdir build -cd build - -#生成Makefile文件 -cmake .. - -# 编译 -make - -# 运行 +git clone --recursive git@github.com:1291945816/hybrid-repo.git +cd ToTpAuth +cmake -B build -S . +cmake --build build -j 8 +cd build ./ToTpAuth -``` \ No newline at end of file +``` diff --git a/ToTpAuth/include/Totp.h b/ToTpAuth/include/Totp.h index 11992c3..d3cf9b3 100644 --- a/ToTpAuth/include/Totp.h +++ b/ToTpAuth/include/Totp.h @@ -32,7 +32,12 @@ class Totp { initTime_(initTime), timeStep_(timeStep), digit_(digit){} + // 更新密钥的值 + void updateSecret(std::string secret) + { + this->strSecret_ = std::move(secret); + } std::string genTotp(std::time_t currTime) ; ~Totp()=default;