kylin-weather/model/iplocation.h

32 lines
1.1 KiB
C
Raw Normal View History

2022-06-22 18:45:06 +08:00
#ifndef IPLOCATION_H
#define IPLOCATION_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QJsonParseError>
#include <QJsonObject>
#include <QEventLoop>
#include <QTimer>
#include <QNetworkReply>
#include "global/corevar.h"
class Iplocation : public QObject
{
Q_OBJECT
public:
explicit Iplocation(QObject *parent = nullptr);
QString gotoLocation(); //去定位
private:
QString pconlineLocation(const QString &url); //高德定位
QString ipipLocation(); // ipip定位
QTimer m_timer; //超时处理--定位
QTimer m_timerGeo; //超时处理--高德
QTimer m_timerIPIP; //超时处理--ipip
bool timeOut(QTimer *timer, QNetworkReply *reply, QEventLoop *eventloop);
const QString codeFirst = QString("aXA/a2V5PWZhZjhmYWFkNA=="); //第一段加密内容
QString decodeToOrigin(const QString &codeStr1, const QString &codeStr2, const QString &codeStr3); //解密
const QString getCodeThird();
signals:
};
#endif // IPLOCATION_H