2023-08-24 15:50:37 +08:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Window 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import FluentUI 1.0
|
2023-04-22 16:02:52 +08:00
|
|
|
|
2023-10-17 15:17:05 +08:00
|
|
|
Item {
|
2023-06-25 19:01:22 +08:00
|
|
|
id: app
|
2023-07-20 18:26:47 +08:00
|
|
|
|
2023-09-17 20:36:33 +08:00
|
|
|
Connections{
|
|
|
|
target: FluTheme
|
|
|
|
function onDarkModeChanged(){
|
|
|
|
SettingsHelper.saveDarkMode(FluTheme.darkMode)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-15 17:24:33 +08:00
|
|
|
Connections{
|
|
|
|
target: FluApp
|
|
|
|
function onVsyncChanged(){
|
|
|
|
SettingsHelper.saveVsync(FluApp.vsync)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-20 18:26:47 +08:00
|
|
|
FluHttpInterceptor{
|
|
|
|
id:interceptor
|
|
|
|
function onIntercept(request){
|
|
|
|
if(request.method === "get"){
|
|
|
|
request.params["method"] = "get"
|
|
|
|
}
|
|
|
|
if(request.method === "post"){
|
|
|
|
request.params["method"] = "post"
|
|
|
|
}
|
|
|
|
request.headers["token"] ="yyds"
|
|
|
|
request.headers["os"] ="pc"
|
2023-07-25 21:24:45 +08:00
|
|
|
console.debug(JSON.stringify(request))
|
2023-07-20 18:26:47 +08:00
|
|
|
return request
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-22 16:02:52 +08:00
|
|
|
Component.onCompleted: {
|
|
|
|
FluApp.init(app)
|
2023-10-15 17:24:33 +08:00
|
|
|
FluApp.vsync = SettingsHelper.getVsync()
|
2023-09-17 20:36:33 +08:00
|
|
|
FluTheme.darkMode = SettingsHelper.getDarkMode()
|
2023-07-07 16:04:17 +08:00
|
|
|
FluTheme.enableAnimation = true
|
2023-04-22 16:02:52 +08:00
|
|
|
FluApp.routes = {
|
2023-04-27 09:38:57 +08:00
|
|
|
"/":"qrc:/example/qml/window/MainWindow.qml",
|
|
|
|
"/about":"qrc:/example/qml/window/AboutWindow.qml",
|
|
|
|
"/login":"qrc:/example/qml/window/LoginWindow.qml",
|
2023-07-11 16:43:28 +08:00
|
|
|
"/hotload":"qrc:/example/qml/window/HotloadWindow.qml",
|
2023-04-27 09:38:57 +08:00
|
|
|
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
|
|
|
|
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
|
2023-08-26 17:20:30 +08:00
|
|
|
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml",
|
|
|
|
"/pageWindow":"qrc:/example/qml/window/PageWindow.qml"
|
2023-04-22 16:02:52 +08:00
|
|
|
}
|
|
|
|
FluApp.initialRoute = "/"
|
2023-07-20 18:26:47 +08:00
|
|
|
FluApp.httpInterceptor = interceptor
|
2023-04-22 16:02:52 +08:00
|
|
|
FluApp.run()
|
|
|
|
}
|
|
|
|
}
|