| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef TAPI_H
- #define TAPI_H
- #include <QNetworkAccessManager>
- #include <QObject>
- namespace TC {
- class NetworkAccessManager : public QNetworkAccessManager
- {
- Q_OBJECT
- public:
- NetworkAccessManager(QObject *parent = nullptr);
- static NetworkAccessManager *instance();
- protected:
- QNetworkReply *createRequest(Operation op,
- const QNetworkRequest &request,
- QIODevice *outgoingData) override;
- };
- // 正常请求数据信息
- // {
- // "code": 200,
- // "msg": "OK",
- // "data": {
- // "access_token": "",
- // "access_expire": 1710850692,
- // "refresh_after": 1710849792
- // }
- // }
- enum RequestCode : int {
- OK = 200,
- GeneralServerError = 100001,
- InvalidRequest = 100002,
- TokenExpired = 100003,
- DatabaseError = 100005,
- // 用户错误代码
- UsernameError = 101001,
- InvalidPhoneFormat = 101002,
- PasswordRequirementsNotMet = 101003,
- PhoneAlreadyRegistered = 101004,
- IncorrectCredentials = 101005,
- GetPhoneCodeError = 101010,
- PhoneCodeExists = 101011,
- PhoneCodeNotFound = 101012,
- CorrectVerificationCode = 101013,
- UpdateLoginPasswordFailed = 101014,
- RealNameVerificationFailed = 101020,
- VIPExpirationTimeFailed = 101030
- };
- } // namespace TC
- #endif // TAPI_H
|