Skip to content

Commit

Permalink
Merge pull request #63 from jamebal/share
Browse files Browse the repository at this point in the history
chore
  • Loading branch information
jamebal authored May 25, 2024
2 parents 92c541a + e717328 commit 606b869
Showing 1 changed file with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import cn.hutool.core.util.RandomUtil;
import com.jmal.clouddisk.exception.CommonException;
import com.jmal.clouddisk.exception.ExceptionType;
import com.jmal.clouddisk.interceptor.AuthInterceptor;
import com.jmal.clouddisk.model.*;
import com.jmal.clouddisk.model.rbac.ConsumerDO;
import com.jmal.clouddisk.oss.web.WebOssService;
Expand All @@ -15,7 +14,6 @@
import com.jmal.clouddisk.service.IShareService;
import com.jmal.clouddisk.service.IUserService;
import com.jmal.clouddisk.util.*;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.Sort;
Expand Down Expand Up @@ -186,28 +184,6 @@ public void validShare(String shareToken, String shareId) {
validShare(shareToken, shareDO);
}

@Override
public void validShare(HttpServletRequest request) {
String shareToken = request.getHeader(Constants.SHARE_TOKEN);
String shareId = request.getHeader(Constants.SHARE_ID);
if (CharSequenceUtil.isBlank(shareToken)) {
shareToken = request.getParameter(Constants.SHARE_TOKEN);
}
if (CharSequenceUtil.isBlank(shareId)) {
shareId = request.getParameter(Constants.SHARE_ID);
}
if (CharSequenceUtil.isBlank(shareToken)) {
shareToken = AuthInterceptor.getCookie(request, Constants.SHARE_TOKEN);
}
if (CharSequenceUtil.isBlank(shareId)) {
shareId = AuthInterceptor.getCookie(request, Constants.SHARE_ID);
}
if (CharSequenceUtil.isBlank(shareId) || CharSequenceUtil.isBlank(shareToken)) {
throw new CommonException(ExceptionType.WARNING.getCode(), Constants.LINK_FAILED);
}
validShare(shareToken, shareId);
}

@Override
public void mountFile(UploadApiParamDTO upload) {
if (upload.getShareId() == null) {
Expand Down

0 comments on commit 606b869

Please sign in to comment.