feat/vtk-3d-view #7
|
|
@ -44,6 +44,7 @@ add_executable(geopro_desktop WIN32
|
|||
panels/chart/TrajectoryMapView.cpp
|
||||
panels/chart/DetailViewFactory.cpp
|
||||
resources/map/map.qrc
|
||||
resources/keys.qrc
|
||||
panels/chart/ChartTheme.cpp
|
||||
panels/chart/ColorMapService.cpp
|
||||
panels/chart/ColorBarWidget.cpp
|
||||
|
|
|
|||
|
|
@ -16,10 +16,8 @@
|
|||
// - 右 属性:选中数据集属性文本。
|
||||
// 世界系:启动 loadGrid("grid1") 取一次,用其 lat/lon 中位/均值作 GeoLocalFrame(全项目共享,保证多视图配准)。
|
||||
|
||||
#include <fstream>
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <typeinfo>
|
||||
#include <vector>
|
||||
|
|
@ -207,16 +205,6 @@ private:
|
|||
QWidget* host_;
|
||||
};
|
||||
|
||||
// 读取 RSA 公钥 PEM 全文(登录时密码加密用)。读不到返回空串,登录将报错。
|
||||
std::string readPem(const std::string& path)
|
||||
{
|
||||
std::ifstream in(path, std::ios::binary);
|
||||
if (!in) return {};
|
||||
std::ostringstream ss;
|
||||
ss << in.rdbuf();
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
// 取 vector 中位数(用于由测线 lat/lon 推世界系原点)。空则返回 0。
|
||||
double median(std::vector<double> v)
|
||||
{
|
||||
|
|
@ -1757,9 +1745,17 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
}
|
||||
|
||||
// 网络层:共享会话 ApiClient + 登录编排 AuthService(RSA 公钥从 resources 读取)。
|
||||
// 网络层:共享会话 ApiClient + 登录编排 AuthService。
|
||||
// RSA 登录公钥内嵌于二进制(qrc :/keys),不依赖外部文件路径——部署到任意机器均可用。
|
||||
geopro::net::ApiClient api(QStringLiteral("http://tenant.geomative.cn/pop-api"));
|
||||
const std::string pem = readPem("D:/Git/lanbingtech/geopro/resources/rsa_public_key.pem");
|
||||
std::string pem;
|
||||
{
|
||||
QFile pemFile(QStringLiteral(":/keys/rsa_public_key.pem"));
|
||||
if (pemFile.open(QIODevice::ReadOnly)) {
|
||||
const QByteArray bytes = pemFile.readAll();
|
||||
pem.assign(bytes.constData(), static_cast<size_t>(bytes.size()));
|
||||
}
|
||||
}
|
||||
geopro::net::AuthService auth(api, pem);
|
||||
|
||||
// 记住登录:若上次勾选「记住」且未超 30 天,凭证库里有有效 token → 免登录直接进。
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<!-- RSA 登录公钥(公钥,可安全内嵌进二进制)。alias 指向仓库根 resources/ 下的单一来源,
|
||||
避免复制。运行时经 :/keys/rsa_public_key.pem 读取,不依赖任何外部文件路径。 -->
|
||||
<qresource prefix="/keys">
|
||||
<file alias="rsa_public_key.pem">../../../resources/rsa_public_key.pem</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
Loading…
Reference in New Issue