This commit is contained in:
hahwu 2026-05-11 11:36:11 +08:00
parent fa9b8df0c3
commit 41c4e3a432
3 changed files with 3 additions and 12 deletions

View File

@ -17,6 +17,7 @@ import (
const (
apkStorageRoot = "./runtime/apk"
apkManifestName = "manifest.json"
apkStaticURLPrefix = "/apk-static"
defaultApkUploadToken = "apk-upload-token"
apkUploadTokenHeader = "X-Apk-Upload-Token"
apkUploadTokenEnvName = "APK_UPLOAD_TOKEN"
@ -208,7 +209,7 @@ func apkManifestPath() string {
}
func apkDownloadPath(env string, packageType string) string {
return fmt.Sprintf("/api/apk/download/%s?packageType=%s", env, packageType)
return fmt.Sprintf("%s/%s/%s/%s", apkStaticURLPrefix, env, packageType, defaultApkStorageName)
}
func isValidApkEnv(env string) bool {

View File

@ -16,18 +16,10 @@ import (
func AppList(c *gin.Context) {
Server := model.Server{}
AppList, err := Server.AppList()
Role, err := model.GetAdminRole(c)
if err != nil {
failed(c, err.Error())
return
}
if Role != util.RoleSuper {
for i := 0; i < len(AppList); i++ {
if AppList[i].AppId == 0 {
AppList = append(AppList[:i], AppList[i+1:]...)
}
}
}
success(c, AppList)
}

View File

@ -52,9 +52,7 @@ func UserAliveMonitor(AppId int) {
func ServerInfoMonitor() {
for {
now := time.Now()
next := now.Truncate(1 * time.Minute).Add(1 * time.Minute)
time.Sleep(time.Until(next))
time.Sleep(time.Second * 10)
monitorServerInfo()
}
}