You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
695 B
25 lines
695 B
package com.ruoyi.system.file;
|
|
|
|
import com.muta.common.config.AliConfig;
|
|
import com.muta.common.core.service.ISysFileService;
|
|
import com.muta.common.utils.oss.OSSSignatureExample;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
/**
|
|
* @author: Larry
|
|
* @Date: 2024 /06 /06 / 16:23
|
|
* @Description:
|
|
*/
|
|
@Component
|
|
public class FileSignature {
|
|
@Resource
|
|
private ISysFileService aliOssService;
|
|
public String getSignUrl(String fileUrl){
|
|
AliConfig aliConfig = new AliConfig();
|
|
aliOssService.getConfig(aliConfig);
|
|
return OSSSignatureExample.generateSignedUrl(aliConfig, fileUrl.substring(fileUrl.lastIndexOf("/") + 1));
|
|
}
|
|
}
|