diff --git a/app/config.py b/app/config.py index d962a39..4b9e465 100644 --- a/app/config.py +++ b/app/config.py @@ -1,4 +1,4 @@ -version = '1.1.2' +version = '1.0.2' contact = '701805520' github = 'https://github.com/LC044/WeChatMsg' website = 'https://memotrace.lc044.love/' @@ -22,11 +22,11 @@ about = f''' ''' # 数据存放文件路径 - INFO_FILE_PATH = './app/data/info.json' # 个人信息文件 DB_DIR = './app/Database/Msg' OUTPUT_DIR = './data/' # 输出文件夹 # 全局参数 - SEND_LOG_FLAG = True # 是否发送错误日志 +SERVER_API_URL = 'http://api.lc044.love' # api接口 +# SERVER_API_URL = 'http://127.0.0.1:8000' # api接口 \ No newline at end of file diff --git a/app/ui/tool/get_bias_addr/get_bias_addr.py b/app/ui/tool/get_bias_addr/get_bias_addr.py index 3fd340c..500c73f 100644 --- a/app/ui/tool/get_bias_addr/get_bias_addr.py +++ b/app/ui/tool/get_bias_addr/get_bias_addr.py @@ -1,11 +1,13 @@ import json import os.path +from urllib.parse import urljoin import requests from PyQt5.QtCore import pyqtSignal, QThread from PyQt5.QtWidgets import QWidget, QMessageBox from app.components.QCursorGif import QCursorGif +from app.config import SERVER_API_URL from app.decrypt.get_bias_addr import BiasAddr from .getBiasAddrUi import Ui_Form @@ -98,7 +100,7 @@ class GetBiasAddrControl(QWidget, Ui_Form, QCursorGif): ) def upload(self, version_data): - url = "http://api.lc044.love/wxBiasAddr" + url = urljoin(SERVER_API_URL,'wxBiasAddr') try: requests.post(url, json=version_data) print('版本信息上传成功') diff --git a/app/ui/tool/pc_decrypt/pc_decrypt.py b/app/ui/tool/pc_decrypt/pc_decrypt.py index 92472f4..ca46ba9 100644 --- a/app/ui/tool/pc_decrypt/pc_decrypt.py +++ b/app/ui/tool/pc_decrypt/pc_decrypt.py @@ -2,6 +2,7 @@ import json import os.path import sys import traceback +from urllib.parse import urljoin import requests from PyQt5.QtCore import pyqtSignal, QThread, QUrl @@ -11,7 +12,7 @@ from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog from app.DataBase import msg_db, misc_db, close_db from app.DataBase.merge import merge_databases, merge_MediaMSG_databases from app.components.QCursorGif import QCursorGif -from app.config import INFO_FILE_PATH, DB_DIR +from app.config import INFO_FILE_PATH, DB_DIR, SERVER_API_URL from app.decrypt import get_wx_info, decrypt from app.log import logger from app.util import path @@ -296,7 +297,7 @@ class MyThread(QThread): pass def get_bias_add(self, version): - url = "http://api.lc044.love/wxBiasAddr" + url = urljoin(SERVER_API_URL,'wxBiasAddr') data = { 'version': version } diff --git a/app/web_ui/web.py b/app/web_ui/web.py index ff84f4c..5241fb2 100644 --- a/app/web_ui/web.py +++ b/app/web_ui/web.py @@ -1,6 +1,7 @@ import os import sys import time +from urllib.parse import urljoin import requests from flask import Flask, render_template, send_file, jsonify, make_response, request @@ -9,6 +10,7 @@ from pyecharts.charts import Bar from app.DataBase import msg_db, micro_msg_db from app.DataBase.hard_link import decodeExtraBuf from app.analysis import analysis +from app.config import SERVER_API_URL from app.person import Contact, Me, ContactDefault from app.util.emoji import get_most_emoji from app.util.region_conversion import conversion_region_to_chinese @@ -22,7 +24,9 @@ start_time = '2023-1-01 00:00:00' end_time = '2023-12-31 23:59:59' time_range = (start_time, end_time) html: str = '' -api_url = 'http://api.lc044.love/upload' + +api_url = urljoin(SERVER_API_URL,'upload') + def get_contact(wxid) -> ContactDefault | Contact: