12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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
- pageURI = 'http://192.168.60.2:8082/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()
|