mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 18:45:57 +08:00
oss模块增加支持本地环境
This commit is contained in:
parent
88377e2e05
commit
717eec3bf4
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.oss.config;
|
||||
|
||||
import com.ruoyi.oss.constant.OssConstant;
|
||||
import com.ruoyi.oss.properties.OssProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* OSS资源配置
|
||||
*
|
||||
* @author CYC
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
@Configuration
|
||||
public class OssResourceConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler(OssConstant.LOCAL_RESOURCE_PATH + "/**").addResourceLocations("file:///" + OssProperties.getLocalResourceDir());
|
||||
}
|
||||
}
|
||||
@ -23,16 +23,26 @@ public interface OssConstant {
|
||||
/**
|
||||
* 系统数据ids
|
||||
*/
|
||||
List<Long> SYSTEM_DATA_IDS = Arrays.asList(1L, 2L, 3L, 4L);
|
||||
List<Long> SYSTEM_DATA_IDS = Arrays.asList(1L, 2L, 3L, 4L, 5L);
|
||||
|
||||
/**
|
||||
* 云服务商
|
||||
*/
|
||||
String[] CLOUD_SERVICE = new String[] {"aliyun", "qcloud", "qiniu", "obs"};
|
||||
String[] CLOUD_SERVICE = new String[]{"aliyun", "qcloud", "qiniu", "obs"};
|
||||
|
||||
/**
|
||||
* https 状态
|
||||
*/
|
||||
String IS_HTTPS = "Y";
|
||||
|
||||
/**
|
||||
* 本地存储
|
||||
*/
|
||||
Long LOCAL_ENV = 1L;
|
||||
|
||||
/**
|
||||
* 本地存储资源路径
|
||||
*/
|
||||
String LOCAL_RESOURCE_PATH = "/oss/local";
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.oss.core;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.io.file.PathUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.amazonaws.ClientConfiguration;
|
||||
import com.amazonaws.HttpMethod;
|
||||
@ -22,10 +23,17 @@ import com.ruoyi.oss.enumd.AccessPolicyType;
|
||||
import com.ruoyi.oss.enumd.PolicyType;
|
||||
import com.ruoyi.oss.exception.OssException;
|
||||
import com.ruoyi.oss.properties.OssProperties;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -40,34 +48,36 @@ public class OssClient {
|
||||
|
||||
private final OssProperties properties;
|
||||
|
||||
private final AmazonS3 client;
|
||||
private AmazonS3 client;
|
||||
|
||||
public OssClient(String configKey, OssProperties ossProperties) {
|
||||
this.configKey = configKey;
|
||||
this.properties = ossProperties;
|
||||
try {
|
||||
AwsClientBuilder.EndpointConfiguration endpointConfig =
|
||||
new AwsClientBuilder.EndpointConfiguration(properties.getEndpoint(), properties.getRegion());
|
||||
//AmazonS3环境
|
||||
if (!isLocalEnv()) {
|
||||
AwsClientBuilder.EndpointConfiguration endpointConfig =
|
||||
new AwsClientBuilder.EndpointConfiguration(properties.getEndpoint(), properties.getRegion());
|
||||
|
||||
AWSCredentials credentials = new BasicAWSCredentials(properties.getAccessKey(), properties.getSecretKey());
|
||||
AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);
|
||||
ClientConfiguration clientConfig = new ClientConfiguration();
|
||||
if (OssConstant.IS_HTTPS.equals(properties.getIsHttps())) {
|
||||
clientConfig.setProtocol(Protocol.HTTPS);
|
||||
} else {
|
||||
clientConfig.setProtocol(Protocol.HTTP);
|
||||
AWSCredentials credentials = new BasicAWSCredentials(properties.getAccessKey(), properties.getSecretKey());
|
||||
AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);
|
||||
ClientConfiguration clientConfig = new ClientConfiguration();
|
||||
if (OssConstant.IS_HTTPS.equals(properties.getIsHttps())) {
|
||||
clientConfig.setProtocol(Protocol.HTTPS);
|
||||
} else {
|
||||
clientConfig.setProtocol(Protocol.HTTP);
|
||||
}
|
||||
AmazonS3ClientBuilder build = AmazonS3Client.builder()
|
||||
.withEndpointConfiguration(endpointConfig)
|
||||
.withClientConfiguration(clientConfig)
|
||||
.withCredentials(credentialsProvider)
|
||||
.disableChunkedEncoding();
|
||||
if (!StringUtils.containsAny(properties.getEndpoint(), OssConstant.CLOUD_SERVICE)) {
|
||||
// minio 使用https限制使用域名访问 需要此配置 站点填域名
|
||||
build.enablePathStyleAccess();
|
||||
}
|
||||
this.client = build.build();
|
||||
}
|
||||
AmazonS3ClientBuilder build = AmazonS3Client.builder()
|
||||
.withEndpointConfiguration(endpointConfig)
|
||||
.withClientConfiguration(clientConfig)
|
||||
.withCredentials(credentialsProvider)
|
||||
.disableChunkedEncoding();
|
||||
if (!StringUtils.containsAny(properties.getEndpoint(), OssConstant.CLOUD_SERVICE)) {
|
||||
// minio 使用https限制使用域名访问 需要此配置 站点填域名
|
||||
build.enablePathStyleAccess();
|
||||
}
|
||||
this.client = build.build();
|
||||
|
||||
createBucket();
|
||||
} catch (Exception e) {
|
||||
if (e instanceof OssException) {
|
||||
@ -79,6 +89,12 @@ public class OssClient {
|
||||
|
||||
public void createBucket() {
|
||||
try {
|
||||
//本地环境
|
||||
if (isLocalEnv()) {
|
||||
//创建目录
|
||||
PathUtil.mkdir(Paths.get(getLocalEnvDir()));
|
||||
return;
|
||||
}
|
||||
String bucketName = properties.getBucketName();
|
||||
if (client.doesBucketExistV2(bucketName)) {
|
||||
return;
|
||||
@ -102,13 +118,18 @@ public class OssClient {
|
||||
inputStream = new ByteArrayInputStream(IoUtil.readBytes(inputStream));
|
||||
}
|
||||
try {
|
||||
ObjectMetadata metadata = new ObjectMetadata();
|
||||
metadata.setContentType(contentType);
|
||||
metadata.setContentLength(inputStream.available());
|
||||
PutObjectRequest putObjectRequest = new PutObjectRequest(properties.getBucketName(), path, inputStream, metadata);
|
||||
// 设置上传对象的 Acl 为公共读
|
||||
putObjectRequest.setCannedAcl(getAccessPolicy().getAcl());
|
||||
client.putObject(putObjectRequest);
|
||||
//本地环境
|
||||
if (isLocalEnv()) {
|
||||
FileUtils.copyInputStreamToFile(inputStream, getLocalEnvFile(path));
|
||||
} else {
|
||||
ObjectMetadata metadata = new ObjectMetadata();
|
||||
metadata.setContentType(contentType);
|
||||
metadata.setContentLength(inputStream.available());
|
||||
PutObjectRequest putObjectRequest = new PutObjectRequest(properties.getBucketName(), path, inputStream, metadata);
|
||||
// 设置上传对象的 Acl 为公共读
|
||||
putObjectRequest.setCannedAcl(getAccessPolicy().getAcl());
|
||||
client.putObject(putObjectRequest);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new OssException("上传文件失败,请检查配置信息:[" + e.getMessage() + "]");
|
||||
}
|
||||
@ -116,8 +137,13 @@ public class OssClient {
|
||||
}
|
||||
|
||||
public void delete(String path) {
|
||||
path = path.replace(getUrl() + "/", "");
|
||||
try {
|
||||
path = path.replace(getUrl() + "/", "");
|
||||
//本地环境
|
||||
if (isLocalEnv()) {
|
||||
FileUtils.delete(getLocalEnvFile(path));
|
||||
return;
|
||||
}
|
||||
client.deleteObject(properties.getBucketName(), path);
|
||||
} catch (Exception e) {
|
||||
throw new OssException("删除文件失败,请检查配置信息:[" + e.getMessage() + "]");
|
||||
@ -138,15 +164,39 @@ public class OssClient {
|
||||
* @param path 完整文件路径
|
||||
*/
|
||||
public ObjectMetadata getObjectMetadata(String path) {
|
||||
path = path.replace(getUrl() + "/", "");
|
||||
S3Object object = client.getObject(properties.getBucketName(), path);
|
||||
return object.getObjectMetadata();
|
||||
try {
|
||||
//本地环境
|
||||
if (isLocalEnv()) {
|
||||
ObjectMetadata objectMetadata = new ObjectMetadata();
|
||||
BasicFileAttributes fileAttributes = Files.readAttributes(getLocalEnvFile(path).toPath(), BasicFileAttributes.class);
|
||||
//文件大小
|
||||
objectMetadata.setContentLength(fileAttributes.size());
|
||||
//文件创建时间
|
||||
//fileAttributes.creationTime()
|
||||
//文件最后修改时间
|
||||
objectMetadata.setLastModified(new Date(fileAttributes.lastModifiedTime().toMillis()));
|
||||
return objectMetadata;
|
||||
}
|
||||
path = path.replace(getUrl() + "/", "");
|
||||
S3Object object = client.getObject(properties.getBucketName(), path);
|
||||
return object.getObjectMetadata();
|
||||
} catch (IOException ex) {
|
||||
throw new OssException("获取文件元数据失败,请检查配置信息:[" + ex.getMessage() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
public InputStream getObjectContent(String path) {
|
||||
path = path.replace(getUrl() + "/", "");
|
||||
S3Object object = client.getObject(properties.getBucketName(), path);
|
||||
return object.getObjectContent();
|
||||
try {
|
||||
path = path.replace(getUrl() + "/", "");
|
||||
//本地环境
|
||||
if (isLocalEnv()) {
|
||||
return Files.newInputStream(getLocalEnvFile(path).toPath());
|
||||
}
|
||||
S3Object object = client.getObject(properties.getBucketName(), path);
|
||||
return object.getObjectContent();
|
||||
} catch (IOException ex) {
|
||||
throw new OssException("获取ObjectContent失败,请检查配置信息:[" + ex.getMessage() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
@ -160,18 +210,25 @@ public class OssClient {
|
||||
}
|
||||
return header + properties.getBucketName() + "." + endpoint;
|
||||
}
|
||||
|
||||
//请求路径
|
||||
String path = "/" + properties.getBucketName();
|
||||
//本地,单独处理
|
||||
if (isLocalEnv()) {
|
||||
path = OssConstant.LOCAL_RESOURCE_PATH + "/" + properties.getBucketName();
|
||||
}
|
||||
// minio 单独处理
|
||||
if (StringUtils.isNotBlank(domain)) {
|
||||
return header + domain + "/" + properties.getBucketName();
|
||||
return header + domain + path;
|
||||
}
|
||||
return header + endpoint + "/" + properties.getBucketName();
|
||||
return header + endpoint + path;
|
||||
}
|
||||
|
||||
public String getPath(String prefix, String suffix) {
|
||||
// 生成uuid
|
||||
String uuid = IdUtil.fastSimpleUUID();
|
||||
// 文件路径
|
||||
String path = DateUtils.datePath() + "/" + uuid;
|
||||
String path = DateUtils.dateTime() + "/" + uuid;
|
||||
if (StringUtils.isNotBlank(prefix)) {
|
||||
path = prefix + "/" + path;
|
||||
}
|
||||
@ -190,6 +247,10 @@ public class OssClient {
|
||||
* @param second 授权时间
|
||||
*/
|
||||
public String getPrivateUrl(String objectKey, Integer second) {
|
||||
//本地环境
|
||||
if (isLocalEnv()) {
|
||||
return objectKey;
|
||||
}
|
||||
GeneratePresignedUrlRequest generatePresignedUrlRequest =
|
||||
new GeneratePresignedUrlRequest(properties.getBucketName(), objectKey)
|
||||
.withMethod(HttpMethod.GET)
|
||||
@ -250,4 +311,27 @@ public class OssClient {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 本地环境
|
||||
*/
|
||||
private boolean isLocalEnv() {
|
||||
return OssConstant.LOCAL_ENV.equals(properties.getOssConfigId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地环境文件目录
|
||||
*/
|
||||
private String getLocalEnvDir() {
|
||||
return OssProperties.getLocalResourceDir() + properties.getBucketName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地环境文件对象
|
||||
*
|
||||
* @param path 文件相对路径
|
||||
*/
|
||||
private File getLocalEnvFile(String path) {
|
||||
return new File(FilenameUtils.normalize(getLocalEnvDir() + File.separator + path));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package com.ruoyi.oss.properties;
|
||||
|
||||
import cn.hutool.core.util.SystemPropsUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* OSS对象存储 配置属性
|
||||
*
|
||||
@ -10,6 +13,11 @@ import lombok.Data;
|
||||
@Data
|
||||
public class OssProperties {
|
||||
|
||||
/**
|
||||
* 主建
|
||||
*/
|
||||
private Long ossConfigId;
|
||||
|
||||
/**
|
||||
* 访问站点
|
||||
*/
|
||||
@ -55,4 +63,11 @@ public class OssProperties {
|
||||
*/
|
||||
private String accessPolicy;
|
||||
|
||||
/**
|
||||
* 本地资源目录
|
||||
*/
|
||||
public static String getLocalResourceDir() {
|
||||
return SystemPropsUtil.get("user.dir") + File.separator;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -946,11 +946,12 @@ comment on column sys_oss_config.create_time is '创建时间';
|
||||
comment on column sys_oss_config.update_by is '更新者';
|
||||
comment on column sys_oss_config.update_time is '更新时间';
|
||||
|
||||
insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (1, 'local', 'ruoyi', 'ruoyi123', 'upload', '', 'localhost:8080', '','N', '', '1', '0', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (2, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (3, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (4, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (5, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
insert into sys_oss_config values (6, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', NULL, 'admin', sysdate, 'admin', sysdate);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
|
||||
@ -962,11 +962,12 @@ comment on column sys_oss_config.update_by is '更新者';
|
||||
comment on column sys_oss_config.update_time is '更新时间';
|
||||
comment on column sys_oss_config.remark is '备注';
|
||||
|
||||
insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), NULL);
|
||||
insert into sys_oss_config values (1, 'local', 'ruoyi', 'ruoyi123', 'upload', '', 'localhost:8080', '','N', '', '1', '0', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (2, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (3, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (4, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (5, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 'admin', now(), 'admin', now(), null);
|
||||
insert into sys_oss_config values (6, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 'admin', now(), 'admin', now(), NULL);
|
||||
|
||||
-- 字符串自动转时间 避免框架时间查询报错问题
|
||||
create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$
|
||||
|
||||
@ -689,8 +689,9 @@ create table sys_oss_config (
|
||||
primary key (oss_config_id)
|
||||
) engine=innodb comment='对象存储配置表';
|
||||
|
||||
insert into sys_oss_config values (1, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1' ,'0', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (5, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (1, 'local', 'ruoyi', 'ruoyi123', 'upload', '', 'localhost:8080', '','N', '', '1' ,'0', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (2, 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (3, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (4, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (5, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
insert into sys_oss_config values (6, 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1' ,'1', '', 'admin', sysdate(), 'admin', sysdate(), NULL);
|
||||
|
||||
@ -2332,13 +2332,15 @@ EXEC sp_addextendedproperty
|
||||
'TABLE', N'sys_oss_config'
|
||||
GO
|
||||
|
||||
INSERT INTO sys_oss_config VALUES (N'1', N'minio', N'ruoyi', N'ruoyi123', N'ruoyi', N'', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'0', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
INSERT INTO sys_oss_config VALUES (N'1', N'local', N'ruoyi', N'ruoyi123', N'upload', N'', N'localhost:8080', N'',N'N', N'', N'1', N'0', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
GO
|
||||
INSERT INTO sys_oss_config VALUES (N'2', N'qiniu', N'XXXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N's3-cn-north-1.qiniucs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
INSERT INTO sys_oss_config VALUES (N'2', N'minio', N'ruoyi', N'ruoyi123', N'ruoyi', N'', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
GO
|
||||
INSERT INTO sys_oss_config VALUES (N'3', N'aliyun', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N'oss-cn-beijing.aliyuncs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
INSERT INTO sys_oss_config VALUES (N'3', N'qiniu', N'XXXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N's3-cn-north-1.qiniucs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
GO
|
||||
INSERT INTO sys_oss_config VALUES (N'4', N'qcloud', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi-1250000000', N'', N'cos.ap-beijing.myqcloud.com', N'',N'N', N'ap-beijing', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
INSERT INTO sys_oss_config VALUES (N'4', N'aliyun', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi', N'', N'oss-cn-beijing.aliyuncs.com', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
GO
|
||||
INSERT INTO sys_oss_config VALUES (N'5', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
INSERT INTO sys_oss_config VALUES (N'5', N'qcloud', N'XXXXXXXXXXXXXXX', N'XXXXXXXXXXXXXXX', N'ruoyi-1250000000', N'', N'cos.ap-beijing.myqcloud.com', N'',N'N', N'ap-beijing', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
GO
|
||||
INSERT INTO sys_oss_config VALUES (N'6', N'image', N'ruoyi', N'ruoyi123', N'ruoyi', N'image', N'127.0.0.1:9000', N'',N'N', N'', N'1', N'1', N'', N'admin', getdate(), N'admin', getdate(), NULL)
|
||||
GO
|
||||
|
||||
Loading…
Reference in New Issue
Block a user