Merge pull request #30 from bufanyun/v2.0

修复home中间件加载时机导致的插件接口异常问题
This commit is contained in:
maxbad 2023-06-16 10:28:34 +08:00 committed by GitHub
commit b1a09a575a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 10 deletions

View File

@ -219,7 +219,7 @@ INSERT INTO `hg_test_table` (`id`, `category_id`, `title`, `description`, `conte
- 如果你使用的热编译,那么页面会在生成成功后立即刷新,刷新完成你即可在后台菜单栏中看到`测试表格`菜单。如果不是使用热编译启动,请手动重启服务后刷新。
> 注意热编译自动刷新时考虑到实际开发环境电脑配置不同web端可能会优先于服务端重启加载完成此时会出现新生成菜单没有加载出来或某接口请求超时问题这是服务端正在启动中导致的,一般稍等几秒再试即可。
#### 注意热编译环境下web端往往会快于服务端重启并加载完成此时访问新生成的菜单页面可能会存在某接口请求超时或404问题这是服务端正在重启导致的属于正常现象,一般稍等几秒再试即可。
- 接下来让我们看看生成的表格页面,效果如下:

View File

@ -16,15 +16,13 @@ import (
// Home 前台页面路由
func Home(ctx context.Context, group *ghttp.RouterGroup) {
group.Middleware(service.Middleware().HomeAuth)
// 允许通过根地址访问的路由可以同时加到这里
// 访问地址http://127.0.0.1:8000
group.Group("/", func(group *ghttp.RouterGroup) {
group.Middleware(service.Middleware().HomeAuth)
group.Bind(
base.Site, // 基础
)
})
// 默认访问地址http://127.0.0.1:8000/home
group.Group(simple.RouterPrefix(ctx, consts.AppHome), func(group *ghttp.RouterGroup) {
@ -32,4 +30,5 @@ func Home(ctx context.Context, group *ghttp.RouterGroup) {
base.Site, // 基础
)
})
})
}

View File

@ -500,7 +500,7 @@
watch(
() => tabsViewStore.signal,
(key) => {
if (key != '') {
if (key !== '') {
closeHandleSelect(key);
tabsViewStore.closeSignal('');
}