123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import inspect
- import os
- from PyQt5.QtCore import QUrl
- from PyQt5.QtGui import QIcon
- from PyQt5.QtNetwork import QNetworkCookie
- from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInterceptor, QWebEngineUrlRequestInfo
- from PyQt5.QtWidgets import QApplication
- from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineView, QWebEngineProfile
- from PyQt5.QtWebChannel import QWebChannel
- import sys
- from requests.auth import HTTPBasicAuth
- from PyQt5.QtCore import QObject
- import siwei_config
- pageURI = f"{siwei_config['host']}:{siwei_config['port']}/index"
- def main():
- app = QApplication(sys.argv)
- web_view = QWebEngineView()
- web_view.setWindowTitle("后台管理系统")
- web_view.setMinimumSize(1200, 700)
- current_directory = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
- web_view.setWindowIcon(QIcon(os.path.join(current_directory, "manager.png")))
- page = QWebEnginePage()
-
-
-
-
-
-
-
- page.load(QUrl(pageURI))
- web_view.setPage(page)
-
-
-
-
-
- web_view.show()
- sys.exit(app.exec_())
- if __name__ == '__main__':
- main()
|