diff --git a/app/http/controllers/info_controller.go b/app/http/controllers/info_controller.go
index da29e285..1b80a777 100644
--- a/app/http/controllers/info_controller.go
+++ b/app/http/controllers/info_controller.go
@@ -7,6 +7,7 @@ import (
"github.com/goravel/framework/facades"
"panel/app/models"
+ "panel/app/services"
"panel/packages/helpers"
)
@@ -63,7 +64,20 @@ func (r *InfoController) HomePlugins(ctx http.Context) {
return
}
- Success(ctx, plugins)
+ type pluginsData struct {
+ models.Plugin
+ Name string `json:"name"`
+ }
+
+ var pluginsJson []pluginsData
+ for _, plugin := range plugins {
+ pluginsJson = append(pluginsJson, pluginsData{
+ Plugin: plugin,
+ Name: services.NewPluginImpl().GetBySlug(plugin.Slug).Name,
+ })
+ }
+
+ Success(ctx, pluginsJson)
}
func (r *InfoController) NowMonitor(ctx http.Context) {
diff --git a/public/panel/adminui/src/modules/admin.js b/public/panel/adminui/src/modules/admin.js
index c8bfe29c..5dec0834 100644
--- a/public/panel/adminui/src/modules/admin.js
+++ b/public/panel/adminui/src/modules/admin.js
@@ -796,6 +796,12 @@ layui.define('view', function (exports) {
admin.events.refresh()
}
}
+
+ // 清理所有定时器
+ var highestTimeoutId = setTimeout('')
+ for (var i = 0; i < highestTimeoutId; i++) {
+ clearTimeout(i)
+ }
})
//点击事件
diff --git a/public/panel/adminui/src/modules/view.js b/public/panel/adminui/src/modules/view.js
index b6a74b5e..def1b26c 100644
--- a/public/panel/adminui/src/modules/view.js
+++ b/public/panel/adminui/src/modules/view.js
@@ -63,10 +63,13 @@ layui.define(['laytpl', 'layer'], function (exports) {
delete options.success
delete options.error
- options.data = JSON.stringify(options.data)
+ if (options.type === 'post' || options.type === 'put' || options.type === 'delete' || options.type === 'patch' || options.type === 'POST' || options.type === 'PUT' || options.type === 'DELETE' || options.type === 'PATCH') {
+ options.contentType = 'application/json'
+ options.data = JSON.stringify(options.data)
+ }
return $.ajax($.extend({
- type: 'get', dataType: 'json', contentType: 'application/json', success: function (res) {
+ type: 'get', dataType: 'json', success: function (res) {
var statusCode = response.statusCode
//只有 response 的 code 一切正常才执行 done
diff --git a/public/panel/views/index.html b/public/panel/views/index.html
index 34f66557..2f6d76dd 100644
--- a/public/panel/views/index.html
+++ b/public/panel/views/index.html
@@ -81,7 +81,7 @@ Date: 2023-06-22
@@ -52,14 +52,6 @@
// 设置面板名称
$('#panel-login-name').text(setter.name);
- // 判断并清除定时器
- if (typeof home_timer !== 'undefined') {
- clearInterval(home_timer);
- }
- if (typeof install_plugin_timer !== 'undefined') {
- clearInterval(install_plugin_timer);
- }
-
form.render();
//提交
@@ -93,7 +85,8 @@
* 所以这里强制刷新到主页
* location.hash = search.redirect ? decodeURIComponent(search.redirect) : '/';
*/
- location.href = '/';
+ //location.href = '/';
+ location.hash = search.redirect ? decodeURIComponent(search.redirect) : '/';
});
}
});
diff --git a/public/panel/views/logout.html b/public/panel/views/logout.html
index d9619de8..5823380f 100644
--- a/public/panel/views/logout.html
+++ b/public/panel/views/logout.html
@@ -1,5 +1,5 @@
@@ -21,13 +21,6 @@