mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Modify: clean modals
This commit is contained in:
@@ -114,7 +114,6 @@ func (service *AddUserService) Add() serializer.Response {
|
||||
user.Email = service.User.Email
|
||||
user.GroupID = service.User.GroupID
|
||||
user.Status = service.User.Status
|
||||
user.Score = service.User.Score
|
||||
|
||||
// 检查愚蠢操作
|
||||
if user.ID == 1 && user.GroupID != 1 {
|
||||
|
||||
@@ -115,11 +115,7 @@ func (service *WebDAVAccountService) Delete(c *gin.Context, user *model.User) se
|
||||
func (service *WebDAVListService) Accounts(c *gin.Context, user *model.User) serializer.Response {
|
||||
accounts := model.ListWebDAVAccounts(user.ID)
|
||||
|
||||
// 查找挂载了存储策略的目录
|
||||
folders := model.GetMountedFolders(user.ID)
|
||||
|
||||
return serializer.Response{Data: map[string]interface{}{
|
||||
"accounts": accounts,
|
||||
"folders": serializer.BuildMountedFolderRes(folders, user.Group.PolicyList),
|
||||
}}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ type ShareCreateService struct {
|
||||
Password string `json:"password" binding:"max=255"`
|
||||
RemainDownloads int `json:"downloads"`
|
||||
Expire int `json:"expire"`
|
||||
Score int `json:"score" binding:"gte=0"`
|
||||
Preview bool `json:"preview"`
|
||||
}
|
||||
|
||||
@@ -117,7 +116,6 @@ func (service *ShareCreateService) Create(c *gin.Context) serializer.Response {
|
||||
IsDir: service.IsDir,
|
||||
UserID: user.ID,
|
||||
SourceID: sourceID,
|
||||
Score: service.Score,
|
||||
RemainDownloads: -1,
|
||||
PreviewEnabled: service.Preview,
|
||||
SourceName: sourceName,
|
||||
|
||||
@@ -117,8 +117,6 @@ func (service *ShareListService) List(c *gin.Context, user *model.User) serializ
|
||||
func (service *ShareGetService) Get(c *gin.Context) serializer.Response {
|
||||
shareCtx, _ := c.Get("share")
|
||||
share := shareCtx.(*model.Share)
|
||||
userCtx, _ := c.Get("user")
|
||||
user := userCtx.(*model.User)
|
||||
|
||||
// 是否已解锁
|
||||
unlocked := true
|
||||
@@ -138,11 +136,6 @@ func (service *ShareGetService) Get(c *gin.Context) serializer.Response {
|
||||
share.Viewed()
|
||||
}
|
||||
|
||||
// 如果已经下载过或者是自己的分享,不需要付积分
|
||||
if share.UserID == user.ID || share.WasDownloadedBy(user, c) {
|
||||
share.Score = 0
|
||||
}
|
||||
|
||||
return serializer.Response{
|
||||
Code: 0,
|
||||
Data: serializer.BuildShareResponse(share, unlocked),
|
||||
|
||||
Reference in New Issue
Block a user