修复存储功能
This commit is contained in:
parent
1867438ac6
commit
77bd6d9e5b
|
|
@ -60,6 +60,14 @@
|
|||
>
|
||||
<el-input v-model="formData.region" placeholder="请输入region" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-if="formData.engine == StorageEnum.ALIYUN"
|
||||
label="ENDPOINT"
|
||||
prop="endpoint"
|
||||
>
|
||||
<el-input v-model="formData.endpoint" placeholder="请输入endpoint" clearable />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
|
|
@ -95,6 +103,7 @@ const formData = reactive({
|
|||
secret_key: '',
|
||||
domain: '',
|
||||
region: '', // 腾讯云需要
|
||||
endpoint: '',
|
||||
status: 0
|
||||
})
|
||||
|
||||
|
|
@ -156,6 +165,13 @@ const formRules = {
|
|||
message: '请输入REGION',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
endpoint: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入endpoint',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@ public class SettingStorageServiceImpl implements ISettingStorageService {
|
|||
if (engine.equals("qcloud")) {
|
||||
map.put("region", config.getOrDefault("region", ""));
|
||||
}
|
||||
if (engine.equals("aliyun")) {
|
||||
map.put("endpoint", config.getOrDefault("endpoint", ""));
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
|
|
@ -119,6 +122,7 @@ public class SettingStorageServiceImpl implements ISettingStorageService {
|
|||
break;
|
||||
case "aliyun":
|
||||
map.put("name", "阿里云存储");
|
||||
map.put("endpoint", params.getOrDefault("endpoint", ""));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
# 项目配置
|
||||
like:
|
||||
upload-directory: /www/uploads/likeadmin-java/ # 上传目录
|
||||
unique-identification: WHsAs2rtaav7hor8LdGy #密码盐
|
||||
|
||||
# 框架配置
|
||||
spring:
|
||||
jackson:
|
||||
property-naming-strategy: SNAKE_CASE #下划线返回值和获取值
|
||||
# 数据源配置
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/【库名称】?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
|
||||
type: com.zaxxer.hikari.HikariDataSource # 数据源类型
|
||||
driver-class-name: com.mysql.jdbc.Driver # MySql的驱动
|
||||
username: root # 数据库账号
|
||||
password: root # 数据库密码
|
||||
# Redis配置
|
||||
redis:
|
||||
host: localhost # Redis服务地址
|
||||
port: 6379 # Redis端口
|
||||
password: # Redis密码
|
||||
database: 0 # 数据库索引
|
||||
|
||||
# Mybatis-plus配置 【是否开启SQL日志输出】
|
||||
#mybatis-plus:
|
||||
# configuration:
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
|
@ -119,10 +119,21 @@
|
|||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.38.72.ALL</version>
|
||||
<version>4.39.246.ALL</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- Gson工具 -->
|
||||
<dependency>
|
||||
|
|
@ -213,6 +224,7 @@
|
|||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-pay</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -34,9 +34,9 @@ public class AliyunStorage {
|
|||
* @return String
|
||||
*/
|
||||
public OSS ossClient() {
|
||||
String endpoint = "https://oss-cn-shenzhen.aliyuncs.com";
|
||||
String accessKeyId = this.config.get("accessKey");
|
||||
String accessKeySecret = this.config.get("secretKey");
|
||||
String endpoint = this.config.get("endpoint");
|
||||
String accessKeyId = this.config.get("access_key");
|
||||
String accessKeySecret = this.config.get("secret_key");
|
||||
return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ public class QcloudStorage {
|
|||
* @return String
|
||||
*/
|
||||
public COSClient cosClient() {
|
||||
String secretId = this.config.get("accessKey");
|
||||
String secretKey = this.config.get("secretKey");
|
||||
String secretId = this.config.get("access_key");
|
||||
String secretKey = this.config.get("secret_key");
|
||||
COSCredentials cred = new BasicCOSCredentials(secretId, secretKey);
|
||||
Region region = new Region(this.config.get("region"));
|
||||
ClientConfig clientConfig = new ClientConfig(region);
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ public class QiniuStorage {
|
|||
* @return String
|
||||
*/
|
||||
public String upToken() {
|
||||
String accessKey = this.config.getOrDefault("accessKey", "");
|
||||
String secretKey = this.config.getOrDefault("secretKey", "");
|
||||
String accessKey = this.config.getOrDefault("access_key", "");
|
||||
String secretKey = this.config.getOrDefault("secret_key", "");
|
||||
String bucket = this.config.getOrDefault("bucket", "");
|
||||
Auth auth = Auth.create(accessKey, secretKey);
|
||||
return auth.uploadToken(bucket);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<easyexcel.version>3.1.3</easyexcel.version>
|
||||
<quartz-scheduler.version>2.3.2</quartz-scheduler.version>
|
||||
|
||||
<qiniu.version>7.9.5</qiniu.version>
|
||||
<qiniu.version>7.17.0</qiniu.version>
|
||||
<qcloud-version>5.6.54</qcloud-version>
|
||||
<tencentcloudapi.version>3.1.411</tencentcloudapi.version>
|
||||
<aliyun-oss.version>3.10.2</aliyun-oss.version>
|
||||
|
|
|
|||
Loading…
Reference in New Issue