yxh 4 лет назад
Родитель
Сommit
ab58e03657

+ 2 - 2
internal/app/system/controller/sys_monitor.go

@@ -116,8 +116,8 @@ func (c *sysMonitorController) List(ctx context.Context, req *system.MonitorSear
 	res = &system.MonitorSearchRes{
 		"cpuNum":          cpuNum,
 		"cpuUsed":         cpuUsed,
-		"cpuAvg5":         cpuAvg5,
-		"cpuAvg15":        cpuAvg15,
+		"cpuAvg5":         gconv.String(cpuAvg5),
+		"cpuAvg15":        gconv.String(cpuAvg15),
 		"memTotal":        memTotal,
 		"goTotal":         goTotal,
 		"memUsed":         memUsed,

+ 2 - 2
internal/app/system/service/middleware.go

@@ -64,9 +64,9 @@ func (s *middlewareImpl) Auth(r *ghttp.Request) {
 		accessParamsStr = "?" + gstr.Join(accessParams, "&")
 	}
 	url := gstr.TrimLeft(r.Request.URL.Path, "/") + accessParamsStr
-	/*if r.Method != "GET" && adminId!=1 && !gstr.Contains(url,"api/v1/system/login"){
+	if r.Method != "GET" && adminId != 1 && !gstr.Contains(url, "api/v1/system/login") {
 		libResponse.FailJson(true, r, "对不起!演示系统,不能删改数据!")
-	}*/
+	}
 	//获取无需验证权限的用户id
 	tagSuperAdmin := false
 	User().NotCheckAuthAdminIds(ctx).Iterator(func(v interface{}) bool {