Просмотр исходного кода

Fix 修复图片上传失败的问题

Yue 2 лет назад
Родитель
Сommit
1896cfdb68

+ 1 - 1
SERVER/VberAdminPlus/script/sql/File.sql

@@ -19,7 +19,7 @@ CREATE TABLE oss_file_short
 DROP TABLE IF EXISTS oss_file;
 CREATE TABLE oss_file
 (
-    id          bigint(20)   NOT NULL,
+    id          bigint(20)   NOT NULL AUTO_INCREMENT,
     pid         varchar(11)  NULL DEFAULT NULL,
     x_path      varchar(255) NULL DEFAULT NULL,
     x_code      varchar(255) NULL DEFAULT NULL,

+ 14 - 14
SERVER/VberAdminPlus/script/sql/VberAdminPlus.sql

@@ -11,7 +11,7 @@ SET FOREIGN_KEY_CHECKS = 0;
 drop table if exists sys_dept;
 create table sys_dept
 (
-    dept_id     bigint(20) not null comment '部门id',
+    dept_id     bigint(20) not null AUTO_INCREMENT comment '部门id',
     parent_id   bigint(20)   default 0 comment '父部门id',
     ancestors   varchar(500) default '' comment '祖级列表',
     dept_name   varchar(30)  default '' comment '部门名称',
@@ -78,7 +78,7 @@ values (109, 102, '0,100,102', '财务部门', 2, '玮搏', '15888888888', 'vber
 drop table if exists sys_user;
 create table sys_user
 (
-    user_id     bigint(20)  not null comment '用户ID',
+    user_id     bigint(20)  not null AUTO_INCREMENT comment '用户ID',
     dept_id     bigint(20)   default null comment '部门ID',
     user_name   varchar(30) not null comment '用户账号',
     nick_name   varchar(30) not null comment '用户昵称',
@@ -124,7 +124,7 @@ values (2, 105, 'system', 'System', 'sys_user', 'system@iwbnet.com', '1566666666
 drop table if exists sys_post;
 create table sys_post
 (
-    post_id     bigint(20)  not null comment '岗位ID',
+    post_id     bigint(20)  not null AUTO_INCREMENT comment '岗位ID',
     post_code   varchar(64) not null comment '岗位编码',
     post_name   varchar(50) not null comment '岗位名称',
     post_sort   int(4)      not null comment '显示顺序',
@@ -156,7 +156,7 @@ values (4, 'user', '普通员工', 4, '0', 'admin', sysdate(), '', null, '');
 drop table if exists sys_role;
 create table sys_role
 (
-    role_id             bigint(20)   not null comment '角色ID',
+    role_id             bigint(20)   not null AUTO_INCREMENT comment '角色ID',
     role_name           varchar(30)  not null comment '角色名称',
     role_key            varchar(100) not null comment '角色权限字符串',
     role_sort           int(4)       not null comment '显示顺序',
@@ -189,7 +189,7 @@ values ('2', '普通角色', 'common', 2, 2, 1, 1, '0', '0', 'admin', sysdate(),
 drop table if exists sys_menu;
 create table sys_menu
 (
-    menu_id     bigint(20)  not null comment '菜单ID',
+    menu_id     bigint(20)  not null AUTO_INCREMENT comment '菜单ID',
     menu_name   varchar(50) not null comment '菜单名称',
     parent_id   bigint(20)   default 0 comment '父菜单ID',
     order_num   int(4)       default 0 comment '显示顺序',
@@ -680,7 +680,7 @@ values ('2', '2');
 drop table if exists sys_oper_log;
 create table sys_oper_log
 (
-    oper_id        bigint(20) not null comment '日志主键',
+    oper_id        bigint(20) not null AUTO_INCREMENT comment '日志主键',
     title          varchar(50)   default '' comment '模块标题',
     business_type  int(2)        default 0 comment '业务类型(0其它 1新增 2修改 3删除)',
     method         varchar(100)  default '' comment '方法名称',
@@ -709,7 +709,7 @@ create table sys_oper_log
 drop table if exists sys_dict_type;
 create table sys_dict_type
 (
-    dict_id     bigint(20) not null comment '字典主键',
+    dict_id     bigint(20) not null AUTO_INCREMENT comment '字典主键',
     dict_name   varchar(100) default '' comment '字典名称',
     dict_type   varchar(100) default '' comment '字典类型',
     status      char(1)      default '0' comment '状态(0正常 1停用)',
@@ -747,7 +747,7 @@ values (10, '系统状态', 'sys_common_status', '0', 'admin', sysdate(), '', nu
 drop table if exists sys_dict_data;
 create table sys_dict_data
 (
-    dict_code   bigint(20) not null comment '字典编码',
+    dict_code   bigint(20) not null AUTO_INCREMENT comment '字典编码',
     dict_sort   int(4)       default 0 comment '字典排序',
     dict_label  varchar(100) default '' comment '字典标签',
     dict_value  varchar(100) default '' comment '字典键值',
@@ -823,7 +823,7 @@ values (28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admi
 drop table if exists sys_config;
 create table sys_config
 (
-    config_id    bigint(20) not null comment '参数主键',
+    config_id    bigint(20) not null AUTO_INCREMENT comment '参数主键',
     config_name  varchar(100) default '' comment '参数名称',
     config_key   varchar(100) default '' comment '参数键名',
     config_value varchar(500) default '' comment '参数键值',
@@ -842,7 +842,7 @@ insert into sys_config
 values (1, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate(), '', null,
         '初始化密码 123456');
 insert into sys_config
-values (2, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', sysdate(), '', null,
+values (2, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'false', 'Y', 'admin', sysdate(), '', null,
         '是否开启验证码功能(true开启,false关闭)');
 insert into sys_config
 values (3, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null,
@@ -854,7 +854,7 @@ values (3, '账号自助-是否开启用户注册功能', 'sys.account.registerU
 drop table if exists sys_logininfor;
 create table sys_logininfor
 (
-    info_id        bigint(20) not null comment '访问ID',
+    info_id        bigint(20) not null AUTO_INCREMENT comment '访问ID',
     user_name      varchar(50)  default '' comment '用户账号',
     ipaddr         varchar(128) default '' comment '登录IP地址',
     login_location varchar(255) default '' comment '登录地点',
@@ -875,7 +875,7 @@ create table sys_logininfor
 drop table if exists sys_notice;
 create table sys_notice
 (
-    notice_id      bigint(20)  not null comment '公告ID',
+    notice_id      bigint(20)  not null AUTO_INCREMENT comment '公告ID',
     notice_title   varchar(50) not null comment '公告标题',
     notice_type    char(1)     not null comment '公告类型(1通知 2公告)',
     notice_content longblob     default null comment '公告内容',
@@ -903,7 +903,7 @@ values ('2', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容'
 drop table if exists gen_table;
 create table gen_table
 (
-    table_id          bigint(20) not null comment '编号',
+    table_id          bigint(20) not null AUTO_INCREMENT comment '编号',
     table_name        varchar(200) default '' comment '表名称',
     table_comment     varchar(500) default '' comment '表描述',
     sub_table_name    varchar(64)  default null comment '关联子表的表名',
@@ -933,7 +933,7 @@ create table gen_table
 drop table if exists gen_table_column;
 create table gen_table_column
 (
-    column_id      bigint(20) not null comment '编号',
+    column_id      bigint(20) not null AUTO_INCREMENT comment '编号',
     table_id       bigint(20) comment '归属表编号',
     column_name    varchar(200) comment '列名称',
     column_comment varchar(500) comment '列描述',

+ 3 - 77
SERVER/VberAdminPlus/vber-admin/src/main/resources/application-prod.yml

@@ -23,8 +23,8 @@ vber:
       sql.show: true
 
 wx:
-  app-id:
-  app-secret:
+  app-id: wxc4d3d210569fd5a0
+  app-secret: 71d1f320b80dd978528507870026083c
 
 sms:
   enabled: true
@@ -65,55 +65,6 @@ xxl.job:
     # 执行器日志文件保存天数:大于3生效
     logretentiondays: 30
 
---- # 数据源配置
-spring:
-  datasource:
-    type: com.zaxxer.hikari.HikariDataSource
-    # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
-    dynamic:
-      # 性能分析插件(有性能损耗 不建议生产环境使用)
-      p6spy: false
-      # 设置默认的数据源或者数据源组,默认值即为 master
-      primary: master
-      # 严格模式 匹配不到数据源则报错
-      strict: true
-      datasource:
-        # 主库数据源
-        master:
-          type: ${spring.datasource.type}
-          driverClassName: com.mysql.cj.jdbc.Driver
-          # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
-          # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://192.168.0.82:3306/VberAdminPlus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
-          username: root
-          password: 123456
-        # 从库数据源
-      #        slave:
-      #          lazy: true
-      #          type: ${spring.datasource.type}
-      #          driverClassName: com.mysql.cj.jdbc.Driver
-      #          url: jdbc:mysql://192.168.0.82:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
-      #          username:
-      #          password:
-
-      hikari:
-        # 最大连接池数量
-        maxPoolSize: 20
-        # 最小空闲线程数量
-        minIdle: 10
-        # 配置获取连接等待超时的时间
-        connectionTimeout: 30000
-        # 校验超时时间
-        validationTimeout: 5000
-        # 空闲连接存活最大时间,默认10分钟
-        idleTimeout: 600000
-        # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
-        maxLifetime: 1800000
-        # 连接测试query(配置检测连接是否有效)
-        connectionTestQuery: SELECT 1
-        # 多久检查一次连接的活性
-        keepaliveTime: 30000
-
 --- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
 spring:
   redis:
@@ -184,29 +135,4 @@ mail:
   # Socket连接超时值,单位毫秒,缺省值不超时
   connectionTimeout: 0
 
---- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
-# https://wind.kim/doc/start 文档地址 各个厂商可同时使用
-sms:
-  # 阿里云 dysmsapi.aliyuncs.com
-  alibaba:
-    #请求地址 默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置
-    requestUrl: dysmsapi.aliyuncs.com
-    #阿里云的accessKey
-    accessKeyId: xxxxxxx
-    #阿里云的accessKeySecret
-    accessKeySecret: xxxxxxx
-    #短信签名
-    signature: 测试
-  tencent:
-    #请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置
-    requestUrl: sms.tencentcloudapi.com
-    #腾讯云的accessKey
-    accessKeyId: xxxxxxx
-    #腾讯云的accessKeySecret
-    accessKeySecret: xxxxxxx
-    #短信签名
-    signature: 测试
-    #短信sdkAppId
-    sdkAppId: appid
-    #地域信息默认为 ap-guangzhou 如无特殊改变可不用设置
-    territory: ap-guangzhou
+

+ 1 - 1
SERVER/VberAdminPlus/vber-oss/src/main/java/com/vber/oss/controller/OssFileController.java

@@ -45,7 +45,7 @@ public class OssFileController extends BaseController {
     }
 
     @PostMapping(value = {"/upload/{path}", "/upload"})
-    public R<UploadFileVo> upload(@RequestPart("file") MultipartFile file, @RequestParam(name = "path", required = false) String path) {
+    public R<UploadFileVo> upload(@RequestPart("file") MultipartFile file, @PathVariable(name = "path", required = false) String path) {
         if (path.isEmpty()) {
             path = "common";
         }

+ 4 - 1
SERVER/VberAdminPlus/vber-system/pom.xml

@@ -21,7 +21,10 @@
             <artifactId>vber-common</artifactId>
         </dependency>
 
-
+        <dependency>
+            <groupId>com.vap</groupId>
+            <artifactId>vber-oss</artifactId>
+        </dependency>
     </dependencies>