-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prefix in webui.json doesn't affact #741
Comments
version 4.2 works, what if turn some configuration back? |
Since the switch to React, the default routing method has been changed to |
If we change NapCatQQ/napcat.webui/src/main.tsx Line 26 in 73b80d2
<HashRouter>
<Provider>
<App />
</Provider>
</HashRouter > The routes would like and change
we can start an integrated proxy server to serve static files, or configure the nginx by users themselves. import config from 'path/to/webui.json'
// `config.prefix`/webui/xxx returns `static_directory`/xxx
// proxy `config.prefix`/api/* to API server |
We will use hash to locate some elements in the future, such as debug page quick locate, to locate the configuration item by hash, so that when sharing the url to other people, they will be able to locate the configuration item or debugging interface location directly through the url (through the browser's ability). If we use hashRouter, the browser's hash localization feature will not work. In this case, we will use the search parameter to achieve similar functionality, but when the user enters the browser page for the first time through the terminal, it will carry a token parameter, and when the login is complete, using the hashRouter to make the jump will result in the browser address becoming something like this: |
Seems that there's no better way. Actually I prefer the |
sorry, to avoid some grey industries, we won't support multiple accounts |
Another way is to register service worker if https enables. But i think it's not an elegent way as it may pollute user's browser. and it brings troube when creating breaking changes |
No, we're not thinking about multi-account situations for now. In fact, for most people, to run an entertainment bot, just need to log in to one account at the same time. |
I understand. |
So in fact the |
In fact, the default config file no longer contains the prefix config item when running the latest version for the first time. This version is a large update release. We have limited members and we focus on feathers first. Document updates will have delays. |
系统版本
(Docker)
QQNT 版本
/
NapCat 版本
4.4.15
OneBot 客户端
/
发生了什么?
prefix
inwebui.json
doesn't affact on frontend.如何复现
webui.json
:Nginx:
Visiting
http://test.example.com/xxx/napcat/webui
, successfully returned html file. But it requests js file with rootThougn it was due to vite configuration:
NapCatQQ/napcat.webui/vite.config.ts
Line 29 in 7f87cee
The
/api
requests ignoredprefix
too:期望的结果?
Changing
/webui/
base to./
may solve the issue if no routes is taken. Or replace/webui/
with prefix at the backend if mimetype istext/html
What if dynamicly load webui.json at frontend?
NapCat 运行日志
OneBot 客户端运行日志
The text was updated successfully, but these errors were encountered: