nolan 4 years ago
parent
commit
ce0a9eae40
  1. 15
      hl-wechat/pom.xml
  2. 2
      hl-wechat/src/main/java/com/ruoyi/hl/config/VideoConfig.java
  3. 2
      hl-wechat/src/main/java/com/ruoyi/hl/config/WxConfig.java
  4. 15
      hl-wechat/src/main/java/com/ruoyi/hl/controller/WxController.java
  5. 28
      hl-wechat/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java
  6. 4
      hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java
  7. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java
  8. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java
  9. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java
  10. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java
  11. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java
  12. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java
  13. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java
  14. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java
  15. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java
  16. 2
      hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java
  17. 2
      hl-wechat/src/main/java/com/ruoyi/hl/service/WxService.java
  18. 10
      hl-wechat/src/main/java/com/ruoyi/hl/service/WxTokenService.java
  19. 99
      hl-wechat/src/main/resources/application.yml
  20. 19
      pom.xml
  21. 6
      ruoyi-admin/pom.xml
  22. 14
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  23. 4
      ruoyi-admin/src/main/java/com/ruoyi/hl/config/VideoConfig.java
  24. 4
      ruoyi-admin/src/main/java/com/ruoyi/hl/config/WxConfig.java
  25. 88
      ruoyi-admin/src/main/java/com/ruoyi/hl/controller/WxController.java
  26. 18
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java
  27. 4
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java
  28. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java
  29. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java
  30. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java
  31. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java
  32. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java
  33. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java
  34. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java
  35. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java
  36. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java
  37. 2
      ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java
  38. 25
      ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxService.java
  39. 17
      ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxTokenService.java
  40. 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
  41. 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/ilisteners/PutProcessData.java
  42. 26
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/FileDao.java
  43. 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/VideoDao.java
  44. 300
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BFileController.java
  45. 73
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideoAllowController.java
  46. 99
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideosController.java
  47. 12
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/ShortLinkController.java
  48. 31
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/VideosController.java
  49. 34
      ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
  50. 86
      ruoyi-admin/src/main/java/com/ruoyi/web/serveice/UploadService.java
  51. 2
      ruoyi-admin/src/main/resources/application-druid.yml
  52. 56
      ruoyi-admin/src/main/resources/application.yml
  53. 12
      ruoyi-common/pom.xml
  54. 4
      ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
  55. 2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/BytesUtil.java
  56. 5
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
  57. 46
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutObjectProgressListener.java
  58. 6
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutProcessData.java
  59. 119
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AliOSSService.java
  60. 60
      ruoyi-system/src/main/java/com/ruoyi/system/domain/BFile.java
  61. 44
      ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideoAllow.java
  62. 2
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/BFileMapper.java
  63. 2
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideoAllowMapper.java
  64. 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/IBFileService.java
  65. 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideoAllowService.java
  66. 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BFileServiceImpl.java
  67. 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideoAllowServiceImpl.java
  68. 27
      ruoyi-system/src/main/resources/mapper/system/BFileMapper.xml
  69. 22
      ruoyi-system/src/main/resources/mapper/system/BVideoAllowMapper.xml
  70. 16
      ruoyi-ui/.env.production
  71. 20
      ruoyi-ui/.env.staging
  72. 180
      ruoyi-ui/package.json
  73. 417
      ruoyi-ui/public/index.html
  74. 18
      ruoyi-ui/src/api/system/file.js
  75. 8
      ruoyi-ui/src/api/system/videos.js
  76. 28
      ruoyi-ui/src/router/index.js
  77. 144
      ruoyi-ui/src/views/system/allow/index.vue
  78. 212
      ruoyi-ui/src/views/system/file/index.vue
  79. 58
      ruoyi-ui/src/views/system/manage/files.vue
  80. 368
      ruoyi-ui/src/views/system/manage/selectFiles.vue
  81. 1228
      ruoyi-ui/src/views/system/role/index.vue
  82. 123
      ruoyi-ui/src/views/system/videos/index.vue

15
hl-wechat/pom.xml

@ -8,6 +8,7 @@
<version>3.8.1</version> <version>3.8.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>hl-wechat</artifactId> <artifactId>hl-wechat</artifactId>
@ -16,4 +17,18 @@
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
</properties> </properties>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>com.dtflys.forest</groupId>
<artifactId>forest-spring-boot-starter</artifactId>
<version>1.5.16</version>
</dependency>
</dependencies>
</project> </project>

2
hl-wechat/src/main/java/com/ruoyi/hl/config/VideoConfig.java

@ -1,4 +1,4 @@
package com.ruoyi.system.config; package com.ruoyi.hl.config;
import lombok.Data; import lombok.Data;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

2
hl-wechat/src/main/java/com/ruoyi/hl/config/WxConfig.java

@ -1,4 +1,4 @@
package com.ruoyi.system.config; package com.ruoyi.hl.config;
import lombok.Getter; import lombok.Getter;

15
hl-wechat/src/main/java/com/ruoyi/hl/controller/WxController.java

@ -1,12 +1,9 @@
package com.ruoyi.system.controller; package com.ruoyi.hl.controller;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.config.WxConfig; import com.ruoyi.hl.config.WxConfig;
import com.ruoyi.system.forest.clients.MiniWeChatClients; import com.ruoyi.hl.forest.clients.MiniWeChatClients;
import com.ruoyi.system.forest.ptoto.WxPublicCode2UserInfoRes; import com.ruoyi.hl.service.WxService;
import com.ruoyi.system.service.WxService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -27,8 +24,8 @@ public class WxController {
@RequestMapping("/getAuth/{id}") @RequestMapping("/getAuth/{id}")
public AjaxResult open(@PathVariable String id){ public AjaxResult open(@PathVariable String id) {
return AjaxResult.success(String.format(wxConfig.getAuthUrl(),wxConfig.getPublicAppid(),wxConfig.getRedirectUrl(),id )); return AjaxResult.success(String.format(wxConfig.getAuthUrl(), wxConfig.getPublicAppid(), wxConfig.getRedirectUrl(), id));
} }
/*@RequestMapping("/code2videourl/{code}/{id}") /*@RequestMapping("/code2videourl/{code}/{id}")

28
hl-wechat/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java

@ -1,13 +1,13 @@
package com.ruoyi.system.forest.clients; package com.ruoyi.hl.forest.clients;
import com.dtflys.forest.annotation.*; import com.dtflys.forest.annotation.*;
import com.ruoyi.system.forest.interceptor.UnlimitedInterceptor; import com.ruoyi.hl.forest.ptoto.WxMiniCode2SessionRes;
import com.ruoyi.system.forest.interceptor.WriteLogInterceptor; import com.ruoyi.hl.forest.ptoto.WxMiniTokenRes;
import com.ruoyi.system.forest.ptoto.WxMiniCode2SessionRes; import com.ruoyi.hl.forest.ptoto.WxPublicCode2UserInfoRes;
import com.ruoyi.system.forest.ptoto.WxMiniTokenRes; import com.ruoyi.hl.forest.ptoto.WxUserInfoRes;
import com.ruoyi.system.forest.ptoto.WxPublicCode2UserInfoRes; import com.ruoyi.hl.forest.interceptor.UnlimitedInterceptor;
import com.ruoyi.system.forest.ptoto.WxUserInfoRes; import com.ruoyi.hl.forest.interceptor.WriteLogInterceptor;
import java.util.Map; import java.util.Map;
@ -49,20 +49,6 @@ public interface MiniWeChatClients {
) )
WxMiniCode2SessionRes code2session(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code); WxMiniCode2SessionRes code2session(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code);
/**
* 获取公众号用户信息
* @param appid
* @param secret
* @param code
* @return
*/
@GetRequest(
url = "/sns/oauth2/access_token?appid=${appid}&secret=${secret}&code=${code}&grant_type=authorization_code",
interceptor = WriteLogInterceptor.class,dataType = "json"
)
WxPublicCode2UserInfoRes code2userinfo(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code);
/** /**
* 获取分享码 * 获取分享码
* @param token * @param token

4
hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.interceptor; package com.ruoyi.hl.forest.interceptor;
import com.dtflys.forest.exceptions.ForestRuntimeException; import com.dtflys.forest.exceptions.ForestRuntimeException;
@ -8,7 +8,7 @@ import com.dtflys.forest.interceptor.Interceptor;
import com.ruoyi.common.utils.BytesUtil; import com.ruoyi.common.utils.BytesUtil;
import com.ruoyi.system.config.WxConfig; import com.ruoyi.hl.config.WxConfig;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.interceptor; package com.ruoyi.hl.forest.interceptor;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.exceptions.ForestRuntimeException; import com.dtflys.forest.exceptions.ForestRuntimeException;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java

@ -1,4 +1,4 @@
package com.ruoyi.system.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
hl-wechat/src/main/java/com/ruoyi/hl/service/WxService.java

@ -1,4 +1,4 @@
package com.ruoyi.system.service; package com.ruoyi.hl.service;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;

10
hl-wechat/src/main/java/com/ruoyi/hl/service/WxTokenService.java

@ -1,17 +1,15 @@
package com.ruoyi.system.service; package com.ruoyi.hl.service;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.system.config.WxConfig; import com.ruoyi.hl.forest.ptoto.WxMiniTokenRes;
import com.ruoyi.system.forest.clients.MiniWeChatClients; import com.ruoyi.hl.config.WxConfig;
import com.ruoyi.system.forest.ptoto.WxMiniTokenRes; import com.ruoyi.hl.forest.clients.MiniWeChatClients;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

99
hl-wechat/src/main/resources/application.yml

@ -1,5 +1,4 @@
#微信配置 #微信配置
wx: wx:
public: public:
redirect_uri: http://asdf.com redirect_uri: http://asdf.com
@ -23,101 +22,3 @@ forest:
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8081
port: 8081
servlet:
# 应用的访问路径
context-path: /
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数,默认为100
accept-count: 1000
threads:
# tomcat最大线程数,默认为200
max: 800
# Tomcat启动初始化的线程数,默认值10
min-spare: 100
# 日志配置
logging:
level:
com.ruoyi: debug
org.springframework: warn
# Spring配置
spring:
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
# 服务模块
devtools:
restart:
# 热部署开关
enabled: true
# redis 配置
redis:
# 地址
host: 192.168.1.182
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# MyBatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping: /wechat
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*

19
pom.xml

@ -39,6 +39,17 @@
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
<version>5.6.0</version>
</dependency>
<dependency>
<groupId>com.dtflys.forest</groupId>
<artifactId>forest-spring-boot-starter</artifactId>
<version>1.5.16</version>
</dependency>
<!-- SpringBoot的依赖配置--> <!-- SpringBoot的依赖配置-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -199,6 +210,7 @@
<version>${ruoyi.version}</version> <version>${ruoyi.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
@ -214,7 +226,12 @@
<dependencies> <dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

6
ruoyi-admin/pom.xml

@ -61,6 +61,12 @@
<artifactId>ruoyi-generator</artifactId> <artifactId>ruoyi-generator</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.dtflys.forest</groupId>
<artifactId>forest-spring-boot-starter</artifactId>
<version>1.5.16</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

14
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@ -3,17 +3,19 @@ package com.ruoyi;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
/** /**
* 启动程序 * 启动程序
* *
* @author ruoyi * @author ruoyi
*/ */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication @EnableScheduling
{ @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public static void main(String[] args) public class RuoYiApplication {
{ public static void main(String[] args) {
// System.setProperty("spring.devtools.restart.enabled", "false"); // System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args); SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +

4
ruoyi-admin/src/main/java/com/ruoyi/hl/config/VideoConfig.java

@ -1,9 +1,11 @@
package hl.config; package com.ruoyi.hl.config;
import lombok.Data; import lombok.Data;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Data @Data
@Component
public class VideoConfig { public class VideoConfig {
@Value("video.baseUrl") @Value("video.baseUrl")
private String baseUrl; private String baseUrl;

4
ruoyi-admin/src/main/java/com/ruoyi/hl/config/WxConfig.java

@ -1,4 +1,4 @@
package hl.config; package com.ruoyi.hl.config;
import lombok.Getter; import lombok.Getter;
@ -26,7 +26,7 @@ public class WxConfig {
private String redirectUrl; private String redirectUrl;
@Getter @Getter
private String authUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect"; private String authUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=%s#wechat_redirect";

88
ruoyi-admin/src/main/java/com/ruoyi/hl/controller/WxController.java

@ -1,14 +1,31 @@
package hl.controller; package com.ruoyi.hl.controller;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import hl.config.WxConfig; import com.ruoyi.framework.web.service.AliOSSService;
import hl.forest.clients.MiniWeChatClients; import com.ruoyi.hl.config.WxConfig;
import hl.service.WxService; import com.ruoyi.hl.forest.clients.MiniWeChatClients;
import com.ruoyi.hl.forest.ptoto.WxPublicCode2UserInfoRes;
import com.ruoyi.hl.forest.ptoto.WxUserInfoRes;
import com.ruoyi.hl.service.WxService;
import com.ruoyi.hl.service.WxTokenService;
import com.ruoyi.system.domain.BFile;
import com.ruoyi.system.domain.BVideoAllow;
import com.ruoyi.system.domain.BVideos;
import com.ruoyi.system.service.IBFileService;
import com.ruoyi.system.service.IBVideoAllowService;
import com.ruoyi.system.service.IBVideosService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Slf4j
@RestController @RestController
@RequestMapping("/wx") @RequestMapping("/wx")
public class WxController { public class WxController {
@ -22,20 +39,71 @@ public class WxController {
@Autowired @Autowired
private WxConfig wxConfig; private WxConfig wxConfig;
@Autowired
private IBVideoAllowService bVideoAllowService;
@Autowired
private IBVideosService videosService;
@Autowired
private IBFileService fileService;
@Autowired
private WxTokenService wxTokenService;
@Autowired
private AliOSSService ossService;
@RequestMapping("/getAuth/{id}") @RequestMapping("/getAuth/{id}")
public AjaxResult open(@PathVariable String id) { public AjaxResult open(@PathVariable String id) {
return AjaxResult.success(String.format(wxConfig.getAuthUrl(), wxConfig.getPublicAppid(), wxConfig.getRedirectUrl(), id)); String auth=String.format(wxConfig.getAuthUrl(), wxConfig.getPublicAppid(), wxConfig.getRedirectUrl(), id);
log.debug("authUrl:{}",auth);
return AjaxResult.success("ok",auth);
} }
/*@RequestMapping("/code2videourl/{code}/{id}") @RequestMapping("/code2videourl/{code}/{id}")
public AjaxResult code2videourl(@PathVariable String id,@PathVariable String code){ public AjaxResult code2videourl(@PathVariable String id,@PathVariable String code){
String openid="a"; String openid="45";
WxPublicCode2UserInfoRes wxPublicCode2UserInfoRes=weChatClients.code2userinfo(wxConfig.getPublicAppid(),wxConfig.getPublicSecret(),code); WxPublicCode2UserInfoRes wxPublicCode2UserInfoRes=weChatClients.code2userinfo(wxConfig.getPublicAppid(),wxConfig.getPublicSecret(),code);
if (wxPublicCode2UserInfoRes.getErrcode()!=0){ if (wxPublicCode2UserInfoRes==null){
log.info("wxPublicCode2UserInfoRes is null");
}
if (StrUtil.isBlankIfStr(wxPublicCode2UserInfoRes.getOpenid())){
return AjaxResult.error("获取openid错误"); return AjaxResult.error("获取openid错误");
} }
openid=wxPublicCode2UserInfoRes.getOpenid(); openid=wxPublicCode2UserInfoRes.getOpenid();
return wxService.getOwnVideo(id,openid); log.info("openId:{}, accessToken:{}",openid,wxPublicCode2UserInfoRes.getAccessToken());
}*/ WxUserInfoRes wxUserInfoRes=weChatClients.userInfo(wxPublicCode2UserInfoRes.getAccessToken(),openid);
String nickname=wxUserInfoRes.getNickname();
return wxService.getOwnVideo(id,openid,nickname);
//return AjaxResult.success("ok",id+"----"+openid);
}
@RequestMapping("/list/{openIds}")
public AjaxResult list(@PathVariable String openIds){
String[] ids=openIds.split("----");
String allowId=ids[0];
String openId=ids[1];
BVideoAllow bVideoAllow=new BVideoAllow();
bVideoAllow.setAllowId(allowId);
bVideoAllow.setWxOpenid(openId);
List<BVideoAllow> allowList= bVideoAllowService.selectBVideoAllowList(bVideoAllow);
if (allowList!=null&&allowList.size()>0){
BVideoAllow allow=allowList.get(0);
BVideos bVideos=new BVideos();
bVideos.setParentId(allow.getVideoId());
List<BVideos> videosList=videosService.selectBVideosList(bVideos);
videosList.forEach(v->{
BFile file=fileService.selectBFileById(v.getFileId());
v.setPath(ossService.getDomain() + "/" + file.getUuid());
});
return AjaxResult.success(videosList);
}else {
return AjaxResult.success(new ArrayList<>());
}
}
} }

18
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java

@ -1,13 +1,13 @@
package hl.forest.clients; package com.ruoyi.hl.forest.clients;
import com.dtflys.forest.annotation.*; import com.dtflys.forest.annotation.*;
import hl.forest.interceptor.UnlimitedInterceptor; import com.ruoyi.hl.forest.interceptor.UnlimitedInterceptor;
import hl.forest.interceptor.WriteLogInterceptor; import com.ruoyi.hl.forest.interceptor.WriteLogInterceptor;
import hl.forest.ptoto.WxMiniCode2SessionRes; import com.ruoyi.hl.forest.ptoto.WxMiniCode2SessionRes;
import hl.forest.ptoto.WxMiniTokenRes; import com.ruoyi.hl.forest.ptoto.WxMiniTokenRes;
import hl.forest.ptoto.WxPublicCode2UserInfoRes; import com.ruoyi.hl.forest.ptoto.WxPublicCode2UserInfoRes;
import hl.forest.ptoto.WxUserInfoRes; import com.ruoyi.hl.forest.ptoto.WxUserInfoRes;
import java.util.Map; import java.util.Map;
@ -30,7 +30,7 @@ public interface MiniWeChatClients {
* *
* @return * @return
*/ */
@GetRequest(url = "/cgi-bin/user/info?access_token=${token}&openid=${openid}&lang=zh_CN", @GetRequest(url = "/sns/userinfo?access_token=${token}&openid=${openid}&lang=zh_CN",
dataType ="json",interceptor = WriteLogInterceptor.class dataType ="json",interceptor = WriteLogInterceptor.class
) )
WxUserInfoRes userInfo(@Var("token") String token, @Var("openid") String openid); WxUserInfoRes userInfo(@Var("token") String token, @Var("openid") String openid);
@ -50,7 +50,7 @@ public interface MiniWeChatClients {
WxMiniCode2SessionRes code2session(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code); WxMiniCode2SessionRes code2session(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code);
/** /**
* 获取公众号用户信息 * 获取信息
* @param appid * @param appid
* @param secret * @param secret
* @param code * @param code

4
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java

@ -1,4 +1,4 @@
package hl.forest.interceptor; package com.ruoyi.hl.forest.interceptor;
import com.dtflys.forest.exceptions.ForestRuntimeException; import com.dtflys.forest.exceptions.ForestRuntimeException;
@ -7,7 +7,7 @@ import com.dtflys.forest.http.ForestResponse;
import com.dtflys.forest.interceptor.Interceptor; import com.dtflys.forest.interceptor.Interceptor;
import com.ruoyi.common.utils.BytesUtil; import com.ruoyi.common.utils.BytesUtil;
import hl.config.WxConfig; import com.ruoyi.hl.config.WxConfig;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java

@ -1,4 +1,4 @@
package hl.forest.interceptor; package com.ruoyi.hl.forest.interceptor;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.exceptions.ForestRuntimeException; import com.dtflys.forest.exceptions.ForestRuntimeException;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

2
ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java

@ -1,4 +1,4 @@
package hl.forest.ptoto; package com.ruoyi.hl.forest.ptoto;
import lombok.Data; import lombok.Data;

25
ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxService.java

@ -1,12 +1,22 @@
package hl.service; package com.ruoyi.hl.service;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.hl.config.VideoConfig;
import com.ruoyi.system.domain.BVideoAllow;
import com.ruoyi.system.domain.BVideos;
import com.ruoyi.system.service.IBVideoAllowService;
import com.ruoyi.system.service.IBVideosService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service @Service
public class WxService { public class WxService {
/*@Autowired @Autowired
private IBVideoAllowService ibVideoAllowService; private IBVideoAllowService ibVideoAllowService;
@Autowired @Autowired
private IBVideosService videosService; private IBVideosService videosService;
@ -15,7 +25,7 @@ public class WxService {
private VideoConfig videoConfig; private VideoConfig videoConfig;
public synchronized AjaxResult getOwnVideo(String id, String openid){ public synchronized AjaxResult getOwnVideo(String id, String openid,String nickname){
BVideoAllow bVideoAllow =new BVideoAllow(); BVideoAllow bVideoAllow =new BVideoAllow();
bVideoAllow.setAllowId(id); bVideoAllow.setAllowId(id);
@ -28,6 +38,7 @@ public class WxService {
String loadOpenid=allow.getWxOpenid(); String loadOpenid=allow.getWxOpenid();
if (StrUtil.isBlankIfStr(loadOpenid)){ if (StrUtil.isBlankIfStr(loadOpenid)){
allow.setWxOpenid(openid); allow.setWxOpenid(openid);
allow.setWxNickname(nickname);
ibVideoAllowService.updateBVideoAllow(allow); ibVideoAllowService.updateBVideoAllow(allow);
}else if (!loadOpenid.equals(openid)){ }else if (!loadOpenid.equals(openid)){
@ -38,6 +49,6 @@ public class WxService {
return AjaxResult.error(404,"未找到视频"); return AjaxResult.error(404,"未找到视频");
} }
return AjaxResult.success(id+"----"+openid); return AjaxResult.success("ok",id+"----"+openid);
}*/ }
} }

17
ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxTokenService.java

@ -1,15 +1,16 @@
package hl.service; package com.ruoyi.hl.service;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import hl.config.WxConfig; import com.ruoyi.hl.config.WxConfig;
import hl.forest.clients.MiniWeChatClients; import com.ruoyi.hl.forest.clients.MiniWeChatClients;
import hl.forest.ptoto.WxMiniTokenRes; import com.ruoyi.hl.forest.ptoto.WxMiniTokenRes;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -26,7 +27,7 @@ public class WxTokenService implements CommandLineRunner {
private MiniWeChatClients miniWeChatClients; private MiniWeChatClients miniWeChatClients;
//@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@Autowired @Autowired
@ -34,7 +35,7 @@ public class WxTokenService implements CommandLineRunner {
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
//refreshToken();//刷新token refreshToken();//刷新token
} }
@ -51,11 +52,11 @@ public class WxTokenService implements CommandLineRunner {
/** /**
* 每分钟检测redis里的token是否到期 * 每分钟检测redis里的token是否到期
*/ */
//@Scheduled(cron = "0 * * * * ?") @Scheduled(cron = "0 * * * * ?")
public void refreshToken() { public void refreshToken() {
String pToken = redisCache.getCacheObject(pTokenK); String pToken = redisCache.getCacheObject(pTokenK);
if (pToken == null || pToken.equals("token")) { if (pToken == null || pToken.equals("token")) {
refreshPublicToken(); //refreshPublicToken();
} }
} }

8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java

@ -6,7 +6,10 @@ import java.util.concurrent.TimeUnit;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.web.controller.mapper.VideoDao;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FastByteArrayOutputStream; import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -38,6 +41,11 @@ public class CaptchaController
@Autowired @Autowired
private ISysConfigService configService; private ISysConfigService configService;
@Autowired
private VideoDao videoDao;
/** /**
* 生成验证码 * 生成验证码
*/ */

2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/ilisteners/PutProcessData.java

@ -1,4 +1,4 @@
package com.ruoyi.web.controller.listener; package com.ruoyi.web.controller.ilisteners;
import lombok.Data; import lombok.Data;

26
ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/FileDao.java

@ -1,2 +1,26 @@
package com.ruoyi.web.controller.mapper;public class FileDao { package com.ruoyi.web.controller.mapper;
import com.ruoyi.system.domain.BFile;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import java.util.List;
@Mapper
public interface FileDao {
@Select("<script>" +
"select * from b_file " +
"" + " <where> done =1 and id \n" +
"NOT IN" +
"<foreach item='t' collection='list' open='(' separator=',' close=')'>" +
"#{t}" +
"</foreach>" +
"</where>" +
"</script>")
@Results({
@Result(column="video_name", property="videoName", jdbcType= JdbcType.VARCHAR),
})
public List<BFile> findByNoIds(@Param("list") List<Long> ids);
} }

4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/VideoDao.java

@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface Dao { public interface VideoDao {
@Select("select file_id from b_video where parent_id= #{id}") @Select("select file_id from b_videos where parent_id= #{id}")
List<Long> findByParentId(long id); List<Long> findByParentId(long id);
} }

300
ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BFileController.java

@ -1,17 +1,31 @@
package com.ruoyi.system.controller; package com.ruoyi.web.controller.upload;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.oss.OSS;
import com.github.pagehelper.PageHelper;
import com.ruoyi.framework.web.ilisteners.PutProcessData;
import com.ruoyi.framework.web.service.AliOSSService;
import com.ruoyi.system.domain.BVideos;
import com.ruoyi.system.service.IBVideosService;
import com.ruoyi.web.controller.mapper.FileDao;
import com.ruoyi.web.controller.mapper.VideoDao;
import com.ruoyi.web.serveice.UploadService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -20,64 +34,227 @@ import com.ruoyi.system.domain.BFile;
import com.ruoyi.system.service.IBFileService; import com.ruoyi.system.service.IBFileService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 请填写功能名称Controller * 请填写功能名称Controller
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-09
*/ */
@RestController @RestController
@RequestMapping("/system/file") @RequestMapping("/videos/file")
public class BFileController extends BaseController public class BFileController extends BaseController {
{
@Autowired @Autowired
private IBFileService bFileService; private IBFileService bFileService;
@Autowired
private IBVideosService videosService;
@Autowired
private AliOSSService ossService;
@Autowired
private VideoDao videoDao;
@Autowired
private FileDao fileDao;
@Autowired
private UploadService uploadService;
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
*/ */
@PreAuthorize("@ss.hasPermi('system:file:list')") @PreAuthorize("@ss.hasPermi('system:file:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BFile bFile) public TableDataInfo list(BFile bFile) {
{
startPage(); startPage();
PageHelper.orderBy("id desc");
List<BFile> list = bFileService.selectBFileList(bFile); List<BFile> list = bFileService.selectBFileList(bFile);
return getDataTable(list); return getDataTable(list);
} }
/**
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:file:export')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BFile bFile)
{
List<BFile> list = bFileService.selectBFileList(bFile);
ExcelUtil<BFile> util = new ExcelUtil<BFile>(BFile.class);
util.exportExcel(response, list, "【请填写功能名称】数据");
}
/** /**
* 获取请填写功能名称详细信息 * 获取请填写功能名称详细信息
*/ */
@PreAuthorize("@ss.hasPermi('system:file:query')") @PreAuthorize("@ss.hasPermi('system:file:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return AjaxResult.success(bFileService.selectBFileById(id)); return AjaxResult.success(bFileService.selectBFileById(id));
} }
/*
*/
/**
* 新增请填写功能名称
*//*
@PreAuthorize("@ss.hasPermi('system:file:add')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping("/addFile")
public AjaxResult addFile(@RequestParam("file") MultipartFile multipartFile, @RequestParam("remark") String remark, @RequestParam("videoName") String videoName) {
BFile bFile = new BFile();
OSS client = ossService.newOss();
Date now = new Date();
String filename = now.getTime() + "." + FileUtil.getSuffix(multipartFile.getOriginalFilename());
String suffix = "/" + filename;
String path = ossService.getPath(ossService.getPrefix(), suffix);
try {
//System.out.println(ossService.getDomain() + "/" + path);
bFile.setGmtCreate(now);
bFile.setVideoName(videoName);
bFile.setPercent("0%");
bFile.setMemo(remark);
bFile.setUuid(path);
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error(e.getMessage());
}
if (bFileService.insertBFile(bFile) > 0) {
File f = null;
try {
f = File.createTempFile("tmp", null);
multipartFile.transferTo(f);
PutProcessData processData = new PutProcessData();
processData.setId(filename);
File finalF = f;
executorService2.execute(new Runnable() {
@Override
public void run() {
ossService.uploadSuffix(client, processData, filename, finalF, suffix);
}
});
executorService.execute(new Runnable() {
@Override
public void run() {
BFile bFile = new BFile();
bFile.setUuid(path);
List<BFile> bFileList = bFileService.selectBFileList(bFile);
BFile findFile = bFileList != null && bFileList.size() > 0 ? bFileList.get(0) : null;
if (findFile == null) {
logger.info("findFile is null");
return;
}
try {
logger.info("upload start");
//ossService.uploadSuffix(client, multipartFile.getBytes(), suffix);
while (true) {
logger.info("v1 upload path:{}, success:{}, fail:{}", path, processData.isSuccess(), processData.isFail());
if (processData.isSuccess() || processData.isFail()) {
if (processData.isSuccess()) {
findFile.setPercent("100%");
findFile.setDone(1L);
} else if (processData.isFail()) {
findFile.setPercent("-1%");
findFile.setDone(2L);
}
bFileService.updateBFile(findFile);
break;
} else {
findFile.setPercent(processData.getProcess() + "%");
bFileService.updateBFile(findFile);
}
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
logger.info("upload success, url:{}", path);
}
});
} catch (Exception e) {
e.printStackTrace();
} finally {
if (f != null) {
f.delete();
}
}
return toAjax(1);
} else {
return toAjax(0);
}
}
*/
/** /**
* 新增请填写功能名称 * 新增请填写功能名称
*/ */
@PreAuthorize("@ss.hasPermi('system:file:add')") @PreAuthorize("@ss.hasPermi('system:file:add')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping @PostMapping("/addFile")
public AjaxResult add(@RequestBody BFile bFile) public AjaxResult addFile(@RequestParam("file") MultipartFile multipartFile, @RequestParam("remark") String remark, @RequestParam("videoName") String videoName) {
{ BFile bFile = new BFile();
return toAjax(bFileService.insertBFile(bFile));
Date now = new Date();
String filename = now.getTime() + "." + FileUtil.getSuffix(multipartFile.getOriginalFilename());
String suffix = "/" + filename;
String path = ossService.getPath(ossService.getPrefix(), suffix);
try {
//System.out.println(ossService.getDomain() + "/" + path);
bFile.setGmtCreate(now);
bFile.setVideoName(videoName);
bFile.setPercent("0%");
bFile.setMemo(remark);
bFile.setUuid(path);
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error(e.getMessage());
}
if (bFileService.insertBFile(bFile) > 0) {
File f = new File("/root/jars/tmp/"+filename);
BFile findFile=null;
try {
if (!f.createNewFile()){
logger.info("create file fail");
return AjaxResult.error("创建文件失败");
}
multipartFile.transferTo(f);
BFile param = new BFile();
param.setUuid(path);
List<BFile> bFileList = bFileService.selectBFileList(param);
findFile = bFileList != null && bFileList.size() > 0 ? bFileList.get(0) : null;
if (findFile == null) {
logger.info("findFile is null");
return AjaxResult.error("保存文件失败");
}
uploadService.uploadFile(findFile,filename,f,suffix);
} catch (IOException e) {
e.printStackTrace();
}
return toAjax(1);
} else {
return toAjax(0);
}
} }
/** /**
@ -86,8 +263,7 @@ public class BFileController extends BaseController
@PreAuthorize("@ss.hasPermi('system:file:edit')") @PreAuthorize("@ss.hasPermi('system:file:edit')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BFile bFile) public AjaxResult edit(@RequestBody BFile bFile) {
{
return toAjax(bFileService.updateBFile(bFile)); return toAjax(bFileService.updateBFile(bFile));
} }
@ -96,9 +272,55 @@ public class BFileController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:file:remove')") @PreAuthorize("@ss.hasPermi('system:file:remove')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{ int updRow = 0;
return toAjax(bFileService.deleteBFileByIds(ids)); OSS client = ossService.newOss();
for (Long id : ids) {
BFile bFile = bFileService.selectBFileById(id);
if (bFile != null) {
try {
ossService.remove(client, ossService.getBucketName(), bFile.getUuid());
updRow += bFileService.deleteBFileById(id);
BVideos bVideos = new BVideos();
bVideos.setFileId(bFile.getId());
List<BVideos> a = videosService.selectBVideosList(bVideos);
if (a != null && a.size() > 0) {
a.forEach(v -> {
videosService.deleteBVideosById(v.getId());
});
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
return toAjax(updRow);
} }
@PreAuthorize("@ss.hasPermi('system:file:query')")
@Log(title = "【请填写功能名称】")
@GetMapping("/getNoAuthFiles")
public AjaxResult getNoAuthFiles(@RequestParam("videoId") Long id, @RequestParam("memo") String memo) {
List<Long> ids = videoDao.findByParentId(id);
if (ids.size() == 0) {
ids.add(-1L);
}
List<BFile> files = fileDao.findByNoIds(ids);
if (StrUtil.isNotBlank(memo)){
files=files.stream().filter(v->{
return v.getMemo().contains(memo);
}).collect(Collectors.toList());
}
return AjaxResult.success(files);
}
} }

73
ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideoAllowController.java

@ -1,7 +1,13 @@
package com.ruoyi.system.controller; package com.ruoyi.web.controller.upload;
import java.util.Date;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.RandomUtil;
import com.ruoyi.common.core.redis.RedisCache;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -23,49 +29,62 @@ import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* 允许列Controller * 允许列Controller
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-10 * @date 2022-03-10
*/ */
@RestController @RestController
@RequestMapping("/system/allow") @RequestMapping("/system/allow")
public class BVideoAllowController extends BaseController public class BVideoAllowController extends BaseController {
{
public static String short_link_key = "short_link_";
public static String short_link_code_key = "short_link_code_";
public static final String ranString=RandomUtil.BASE_CHAR.toUpperCase()+RandomUtil.BASE_CHAR_NUMBER;
@Autowired @Autowired
private IBVideoAllowService bVideoAllowService; private IBVideoAllowService bVideoAllowService;
@Value("${hl.share_domain}")
private String share_domain;
@Value("${hl.share_short_domain}")
private String share_short_domain;
@Autowired
private RedisCache redisCache;
/** /**
* 查询允许列列表 * 查询允许列列表
*/ */
@PreAuthorize("@ss.hasPermi('system:allow:list')") @PreAuthorize("@ss.hasPermi('system:allow:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BVideoAllow bVideoAllow) public TableDataInfo list(BVideoAllow bVideoAllow) {
{
startPage(); startPage();
List<BVideoAllow> list = bVideoAllowService.selectBVideoAllowList(bVideoAllow); List<BVideoAllow> list = bVideoAllowService.selectBVideoAllowList(bVideoAllow);
list.forEach(v -> {
String short_link = redisCache.getCacheObject(short_link_key + v.getId());
if (short_link == null) {
String code = RandomUtil.randomString(ranString,7);
redisCache.setCacheObject(short_link_key + v.getId(), share_short_domain + code);
redisCache.setCacheObject(short_link_code_key + code, share_domain + "?isFirst=true&allowId=" + v.getAllowId());
}
v.setLink(short_link);
});
return getDataTable(list); return getDataTable(list);
} }
/**
* 导出允许列列表
*/
@PreAuthorize("@ss.hasPermi('system:allow:export')")
@Log(title = "允许列", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BVideoAllow bVideoAllow)
{
List<BVideoAllow> list = bVideoAllowService.selectBVideoAllowList(bVideoAllow);
ExcelUtil<BVideoAllow> util = new ExcelUtil<BVideoAllow>(BVideoAllow.class);
util.exportExcel(response, list, "允许列数据");
}
/** /**
* 获取允许列详细信息 * 获取允许列详细信息
*/ */
@PreAuthorize("@ss.hasPermi('system:allow:query')") @PreAuthorize("@ss.hasPermi('system:allow:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return AjaxResult.success(bVideoAllowService.selectBVideoAllowById(id)); return AjaxResult.success(bVideoAllowService.selectBVideoAllowById(id));
} }
@ -75,8 +94,10 @@ public class BVideoAllowController extends BaseController
@PreAuthorize("@ss.hasPermi('system:allow:add')") @PreAuthorize("@ss.hasPermi('system:allow:add')")
@Log(title = "允许列", businessType = BusinessType.INSERT) @Log(title = "允许列", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BVideoAllow bVideoAllow) public AjaxResult add(@RequestBody BVideoAllow bVideoAllow) {
{ Date now = new Date();
bVideoAllow.setGmtCreate(now);
bVideoAllow.setAllowId(UUID.randomUUID().toString());
return toAjax(bVideoAllowService.insertBVideoAllow(bVideoAllow)); return toAjax(bVideoAllowService.insertBVideoAllow(bVideoAllow));
} }
@ -86,8 +107,7 @@ public class BVideoAllowController extends BaseController
@PreAuthorize("@ss.hasPermi('system:allow:edit')") @PreAuthorize("@ss.hasPermi('system:allow:edit')")
@Log(title = "允许列", businessType = BusinessType.UPDATE) @Log(title = "允许列", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BVideoAllow bVideoAllow) public AjaxResult edit(@RequestBody BVideoAllow bVideoAllow) {
{
return toAjax(bVideoAllowService.updateBVideoAllow(bVideoAllow)); return toAjax(bVideoAllowService.updateBVideoAllow(bVideoAllow));
} }
@ -96,9 +116,8 @@ public class BVideoAllowController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:allow:remove')") @PreAuthorize("@ss.hasPermi('system:allow:remove')")
@Log(title = "允许列", businessType = BusinessType.DELETE) @Log(title = "允许列", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(bVideoAllowService.deleteBVideoAllowByIds(ids)); return toAjax(bVideoAllowService.deleteBVideoAllowByIds(ids));
} }
} }

99
ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideosController.java

@ -1,17 +1,19 @@
package com.ruoyi.system.controller; package com.ruoyi.web.controller.upload;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.xml.crypto.Data;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.system.domain.BFile;
import com.ruoyi.system.service.IBFileService;
import com.sun.imageio.plugins.common.BitFile;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -23,27 +25,77 @@ import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* 视频信息Controller * 视频信息Controller
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-09
*/ */
@RestController @RestController
@RequestMapping("/system/videos") @RequestMapping("/system/videos")
public class BVideosController extends BaseController public class BVideosController extends BaseController {
{
@Autowired @Autowired
private IBVideosService bVideosService; private IBVideosService bVideosService;
@Autowired
private IBFileService ibFileService;
@PreAuthorize("@ss.hasPermi('system:videos:manageFiles')")
@Log(title = "【请填写功能名称】")
@PostMapping("/insertVideos")
public AjaxResult insert(@RequestBody JSONObject jsonObject) {
Date now = new Date();
JSONArray fileIds = jsonObject.getJSONArray("ids");
for (int i = 0; i < fileIds.size(); i++) {
Long fileId = ((Integer) fileIds.get(i)).longValue();
BFile bFile = ibFileService.selectBFileById(fileId);
BVideos bVideos = new BVideos();
bVideos.setGmtCreate(now);
bVideos.setGmtModified(now);
bVideos.setFileId(fileId);
bVideos.setName(bFile.getVideoName());
bVideos.setParentId(jsonObject.getLong("videoId"));
bVideos.setFileId(fileId);
bVideos.setType(2L);
bVideosService.insertBVideos(bVideos);
}
return AjaxResult.success();
}
/** /**
* 查询视频信息列表 * 查询视频信息列表
*/ */
@PreAuthorize("@ss.hasPermi('system:videos:list')") @PreAuthorize("@ss.hasPermi('system:videos:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BVideos bVideos) public TableDataInfo list(BVideos bVideos) {
{
startPage(); startPage();
List<BVideos> list = bVideosService.selectBVideosList(bVideos); List<BVideos> list = bVideosService.selectBVideosList(bVideos);
return getDataTable(list); JSONArray res = new JSONArray();
for (int i = 0; i < list.size(); i++) {
BVideos videos = list.get(i);
BVideos queryParam = new BVideos();
queryParam.setParentId(videos.getId());
List<BVideos> videoChildren = bVideosService.selectBVideosList(queryParam);
List<String> filenames = new ArrayList<>();
videoChildren.forEach(v -> {
BFile file = ibFileService.selectBFileById(v.getFileId());
if (file != null&&filenames.size()<10)
filenames.add(file.getVideoName());
});
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(videos);
jsonObject.put("filenames", String.join(",", filenames));
res.add(jsonObject);
}
TableDataInfo rspData=getDataTable(list);
rspData.setRows(res);
return rspData;
} }
/** /**
@ -52,8 +104,7 @@ public class BVideosController extends BaseController
@PreAuthorize("@ss.hasPermi('system:videos:export')") @PreAuthorize("@ss.hasPermi('system:videos:export')")
@Log(title = "视频信息", businessType = BusinessType.EXPORT) @Log(title = "视频信息", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, BVideos bVideos) public void export(HttpServletResponse response, BVideos bVideos) {
{
List<BVideos> list = bVideosService.selectBVideosList(bVideos); List<BVideos> list = bVideosService.selectBVideosList(bVideos);
ExcelUtil<BVideos> util = new ExcelUtil<BVideos>(BVideos.class); ExcelUtil<BVideos> util = new ExcelUtil<BVideos>(BVideos.class);
util.exportExcel(response, list, "视频信息数据"); util.exportExcel(response, list, "视频信息数据");
@ -64,8 +115,7 @@ public class BVideosController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:videos:query')") @PreAuthorize("@ss.hasPermi('system:videos:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return AjaxResult.success(bVideosService.selectBVideosById(id)); return AjaxResult.success(bVideosService.selectBVideosById(id));
} }
@ -75,8 +125,7 @@ public class BVideosController extends BaseController
@PreAuthorize("@ss.hasPermi('system:videos:add')") @PreAuthorize("@ss.hasPermi('system:videos:add')")
@Log(title = "视频信息", businessType = BusinessType.INSERT) @Log(title = "视频信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BVideos bVideos) public AjaxResult add(@RequestBody BVideos bVideos) {
{
return toAjax(bVideosService.insertBVideos(bVideos)); return toAjax(bVideosService.insertBVideos(bVideos));
} }
@ -86,8 +135,7 @@ public class BVideosController extends BaseController
@PreAuthorize("@ss.hasPermi('system:videos:edit')") @PreAuthorize("@ss.hasPermi('system:videos:edit')")
@Log(title = "视频信息", businessType = BusinessType.UPDATE) @Log(title = "视频信息", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BVideos bVideos) public AjaxResult edit(@RequestBody BVideos bVideos) {
{
return toAjax(bVideosService.updateBVideos(bVideos)); return toAjax(bVideosService.updateBVideos(bVideos));
} }
@ -96,9 +144,8 @@ public class BVideosController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:videos:remove')") @PreAuthorize("@ss.hasPermi('system:videos:remove')")
@Log(title = "视频信息", businessType = BusinessType.DELETE) @Log(title = "视频信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(bVideosService.deleteBVideosByIds(ids)); return toAjax(bVideosService.deleteBVideosByIds(ids));
} }
} }

12
ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/ShortLinkController.java

@ -1,26 +1,20 @@
package com.ruoyi.web.controller.upload; package com.ruoyi.web.controller.upload;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.system.domain.BVideoAllow;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView; import org.springframework.web.servlet.view.RedirectView;
import static com.ruoyi.framework.datasource.DynamicDataSourceContextHolder.log;
@Slf4j @Slf4j
@Controller @Controller
@RequestMapping("/s") @RequestMapping("/s")
public class ShortController { public class ShortLinkController {
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@ -33,9 +27,7 @@ public class ShortController {
@GetMapping("/{code}") @GetMapping("/{code}")
public ModelAndView list(@PathVariable("code") String code) public ModelAndView list(@PathVariable("code") String code)
{ {
String completeUrl=redisCache.getCacheObject(BVideoAllowController.short_link_code_key+code); String completeUrl=redisCache.getCacheObject(BVideoAllowController.short_link_code_key+code);
log.info("jump to completeUrl:{}",completeUrl); log.info("jump to completeUrl:{}",completeUrl);
ModelAndView downloadView = new ModelAndView(new RedirectView(completeUrl)); ModelAndView downloadView = new ModelAndView(new RedirectView(completeUrl));

31
ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/VideosController.java

@ -1,2 +1,31 @@
package com.ruoyi.web.controller.upload;public class UploadFileController { package com.ruoyi.web.controller.upload;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.SysConfig;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.ruoyi.common.utils.PageUtils.startPage;
@RestController
@RequestMapping("/videos")
public class VideosController {
/**
* 获取参数配置列表
*/
/*@PreAuthorize("@ss.hasPermi('videos:list')")
@GetMapping("/list")
public TableDataInfo list(SysConfig config)
{
startPage();
List<SysConfig> list = configService.selectConfigList(config);
return getDataTable(list);
}*/
} }

34
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java

@ -2,6 +2,7 @@ package com.ruoyi.web.core.config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -24,21 +25,27 @@ import springfox.documentation.spring.web.plugins.Docket;
/** /**
* Swagger2的接口配置 * Swagger2的接口配置
* *
* @author ruoyi * @author ruoyi
*/ */
@Configuration @Configuration
public class SwaggerConfig public class SwaggerConfig {
{
/** 系统基础配置 */ /**
* 系统基础配置
*/
@Autowired @Autowired
private RuoYiConfig ruoyiConfig; private RuoYiConfig ruoyiConfig;
/** 是否开启swagger */ /**
* 是否开启swagger
*/
@Value("${swagger.enabled}") @Value("${swagger.enabled}")
private boolean enabled; private boolean enabled;
/** 设置请求的统一前缀 */ /**
* 设置请求的统一前缀
*/
@Value("${swagger.pathMapping}") @Value("${swagger.pathMapping}")
private String pathMapping; private String pathMapping;
@ -46,8 +53,7 @@ public class SwaggerConfig
* 创建API * 创建API
*/ */
@Bean @Bean
public Docket createRestApi() public Docket createRestApi() {
{
return new Docket(DocumentationType.OAS_30) return new Docket(DocumentationType.OAS_30)
// 是否启用Swagger // 是否启用Swagger
.enable(enabled) .enable(enabled)
@ -71,8 +77,7 @@ public class SwaggerConfig
/** /**
* 安全模式这里指定token通过Authorization头请求头传递 * 安全模式这里指定token通过Authorization头请求头传递
*/ */
private List<SecurityScheme> securitySchemes() private List<SecurityScheme> securitySchemes() {
{
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>(); List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
return apiKeyList; return apiKeyList;
@ -81,8 +86,7 @@ public class SwaggerConfig
/** /**
* 安全上下文 * 安全上下文
*/ */
private List<SecurityContext> securityContexts() private List<SecurityContext> securityContexts() {
{
List<SecurityContext> securityContexts = new ArrayList<>(); List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add( securityContexts.add(
SecurityContext.builder() SecurityContext.builder()
@ -95,8 +99,7 @@ public class SwaggerConfig
/** /**
* 默认的安全上引用 * 默认的安全上引用
*/ */
private List<SecurityReference> defaultAuth() private List<SecurityReference> defaultAuth() {
{
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope; authorizationScopes[0] = authorizationScope;
@ -108,8 +111,7 @@ public class SwaggerConfig
/** /**
* 添加摘要信息 * 添加摘要信息
*/ */
private ApiInfo apiInfo() private ApiInfo apiInfo() {
{
// 用ApiInfoBuilder进行定制 // 用ApiInfoBuilder进行定制
return new ApiInfoBuilder() return new ApiInfoBuilder()
// 设置标题 // 设置标题

86
ruoyi-admin/src/main/java/com/ruoyi/web/serveice/UploadService.java

@ -1,2 +1,86 @@
package com.ruoyi.web.serveice;public class UploadService { package com.ruoyi.web.serveice;
import com.aliyun.oss.OSS;
import com.ruoyi.framework.web.ilisteners.PutProcessData;
import com.ruoyi.framework.web.service.AliOSSService;
import com.ruoyi.system.domain.BFile;
import com.ruoyi.system.service.IBFileService;
import com.ruoyi.system.service.IBVideosService;
import com.ruoyi.web.controller.mapper.FileDao;
import com.ruoyi.web.controller.mapper.VideoDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Slf4j
@Component
public class UploadService {
private ExecutorService executorService = Executors.newSingleThreadExecutor();
@Autowired
private IBFileService bFileService;
@Autowired
private IBVideosService videosService;
@Autowired
private AliOSSService ossService;
@Autowired
private VideoDao videoDao;
@Autowired
private FileDao fileDao;
public void uploadFile(BFile bfile, String filename, File f, String suffix){
OSS client = ossService.newOss();
executorService.submit(new Runnable() {
@Override
public void run() {
log.info("upload start v1");
try {
//ossService.uploadSuffix(client, multipartFile.getBytes(), suffix);
PutProcessData processData = new PutProcessData();
processData.setId(filename);
bfile.setDone(3L);
bFileService.updateBFile(bfile);
ossService.uploadSuffix(client, processData, filename, f, suffix,bFileService,bfile);
/*while (true) {
logger.info("upload path:{}, success:{}, fail:{}", path, processData.isSuccess(), processData.isFail());
if (processData.isSuccess() || processData.isFail()) {
if (processData.isSuccess()) {
bfile.setPercent("100%");
bfile.setDone(1L);
} else if (processData.isFail()) {
bfile.setPercent("-1%");
bfile.setDone(2L);
}
bFileService.updateBFile(bfile);
break;
} else {
bfile.setPercent(processData.getProcess() + "%");
bFileService.updateBFile(bfile);
}
Thread.sleep(1000);
}*/
} catch (Exception e) {
e.printStackTrace();
} finally {
f.delete();
}
}
});
}
} }

2
ruoyi-admin/src/main/resources/application-druid.yml

@ -8,7 +8,7 @@ spring:
master: master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: password password: nolan5146
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

56
ruoyi-admin/src/main/resources/application.yml

@ -14,15 +14,67 @@ ruoyi:
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
captchaType: math captchaType: math
ali:
oss:
prefix: videos
domain: https://xd-video-0.oss-cn-shanghai.aliyuncs.com
bucketName: jelkfjoiweur
endpoint: oss-cn-shanghai.aliyuncs.com
accessKey: LTAI5tQLkBCyQGRmKmXyibjK
secret: RJ4kUelf1QySoDVW4JCzcasRHDocsA
# oss:
# prefix: oss
# domain: https://xd-video-0.oss-cn-shanghai.aliyuncs.com
# bucketName: xd-video-0
# endpoint: oss-cn-shanghai.aliyuncs.com
# accessKey: LTAI4G1Rfc8i5sRdBKREgcVV
# secret: V5MRq7o1V1imCgWfKRyGy7cTPpbuku
hl:
#跳转地址
share_domain: http://fajslkdjf.com
share_short_domain: http://fajslkdjf.com
#微信配置
wx:
public:
#微信授权地址
redirect_uri: https://admin.sibaotech.com/test
appid: wxcb8766dc193524dd
secret: ae75181cb64cc5d4156a3d3b805d6fcc
video:
baseUrl:
forest:
variables:
wechat_clients_url: https://api.weixin.qq.com
wechat_mch_clients_url: https://api.mch.weixin.qq.com
## 日志总开关,打开/关闭Forest请求/响应日志
log-enabled: true
## 打开/关闭Forest请求日志
log-request: false
## 打开/关闭Forest响应状态日志
log-response-status: true
## 打开/关闭Forest响应内容日志
log-response-content: true
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口,默认为8080 # 服务器的HTTP端口,默认为8080
port: 8080 port: 8080
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /
tomcat: tomcat:
# tomcat的URI编码 # tomcat的URI编码
uri-encoding: UTF-8 uri-encoding: UTF-8
# 连接数满后的排队数,默认为100 # 连接数满后的排队数,默认为100
@ -51,7 +103,7 @@ spring:
servlet: servlet:
multipart: multipart:
# 单个文件大小 # 单个文件大小
max-file-size: 10MB max-file-size: 1024MB
# 设置总上传的文件大小 # 设置总上传的文件大小
max-request-size: 20MB max-request-size: 20MB
# 服务模块 # 服务模块
@ -99,6 +151,8 @@ mybatis:
mapperLocations: classpath*:mapper/**/*Mapper.xml mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件 # 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml configLocation: classpath:mybatis/mybatis-config.xml
configuration:
map-underscore-to-camel-case: true
# PageHelper分页插件 # PageHelper分页插件
pagehelper: pagehelper:

12
ruoyi-common/pom.xml

@ -16,6 +16,12 @@
</description> </description>
<dependencies> <dependencies>
<!--阿里oss-->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.10.2</version>
</dependency>
<!-- Spring框架基本的核心工具 --> <!-- Spring框架基本的核心工具 -->
<dependency> <dependency>
@ -124,7 +130,11 @@
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
<version>5.6.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

4
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java

@ -20,8 +20,8 @@ import org.springframework.stereotype.Component;
**/ **/
@SuppressWarnings(value = { "unchecked", "rawtypes" }) @SuppressWarnings(value = { "unchecked", "rawtypes" })
@Component @Component
public class RedisCache public class RedisCache {
{
@Autowired @Autowired
public RedisTemplate redisTemplate; public RedisTemplate redisTemplate;

2
ruoyi-common/src/main/java/com/ruoyi/common/utils/BytesUtil.java

@ -1,4 +1,4 @@
package com.github.wxiaoqi.security.common.util; package com.ruoyi.common.utils;
import java.util.Arrays; import java.util.Arrays;

5
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@ -97,17 +97,18 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求 // 过滤请求
.authorizeRequests() .authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage").anonymous() .antMatchers("/login", "/register", "/captchaImage", "/s/*").anonymous()
.antMatchers( .antMatchers(
HttpMethod.GET, HttpMethod.GET,
"/", "/",
"/*.html", "/*.html",
"/**/*.html", "/**/*.html","/wx/**",
"/**/*.css", "/**/*.css",
"/**/*.js", "/**/*.js",
"/profile/**" "/profile/**"
).permitAll() ).permitAll()
.antMatchers("/swagger-ui.html").anonymous() .antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/wx/**").anonymous()
.antMatchers("/swagger-resources/**").anonymous() .antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous() .antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous() .antMatchers("/*/api-docs").anonymous()

46
ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutObjectProgressListener.java

@ -1,8 +1,10 @@
package com.ruoyi.web.controller.ilisteners; package com.ruoyi.framework.web.ilisteners;
import com.aliyun.oss.event.ProgressEvent; import com.aliyun.oss.event.ProgressEvent;
import com.aliyun.oss.event.ProgressEventType; import com.aliyun.oss.event.ProgressEventType;
import com.aliyun.oss.event.ProgressListener; import com.aliyun.oss.event.ProgressListener;
import com.ruoyi.system.domain.BFile;
import com.ruoyi.system.service.IBFileService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
@ -12,17 +14,36 @@ public class PutObjectProgressListener implements ProgressListener {
private long totalBytes = -1; private long totalBytes = -1;
private boolean succeed = false; private boolean succeed = false;
private int percent = 0; private int percent = 0;
int sum = 0;
private boolean fail = false; private boolean fail = false;
private int lastPercent=0;
private IBFileService bFileService ;
private BFile bile;
public void onSuccess(String percent){
bile.setPercent(percent+"%");
bFileService.updateBFile(bile);
}
public void onFail(){
bile.setPercent("-1%");
bile.setDone(2L);
bFileService.updateBFile(bile);
}
public void onCompleted(){
bile.setPercent("100%");
bile.setDone(1L);
bFileService.updateBFile(bile);
}
// 构造方法中加入session // 构造方法中加入session
public PutObjectProgressListener() { public PutObjectProgressListener() {
} }
public PutObjectProgressListener(PutProcessData mSession, int sum) { public PutObjectProgressListener(PutProcessData mSession,IBFileService bFileService, BFile bile) {
this.session = mSession; this.session = mSession;
this.sum = sum; this.bFileService=bFileService;
this.session.setProcess("0 %"); this.bile=bile;
log.info("========================{}============================", session.getId()); log.info("========================{}============================", session.getId());
@ -46,25 +67,34 @@ public class PutObjectProgressListener implements ProgressListener {
if (this.totalBytes != -1) { if (this.totalBytes != -1) {
percent = (int) (this.bytesWritten * 100.0 / this.totalBytes); percent = (int) (this.bytesWritten * 100.0 / this.totalBytes);
// 将进度percent放入session中 // 将进度percent放入session中
this.session.setProcess(percent + " %");
//session.setAttribute("upload_percent", percent); //session.setAttribute("upload_percent", percent);
if (lastPercent!=percent){
lastPercent=percent;
onSuccess(percent+"");
log.info("v1 upload process id:{}, percent:{}", session.getId(), percent);
}
} else { } else {
} }
break; break;
case TRANSFER_COMPLETED_EVENT: case TRANSFER_COMPLETED_EVENT:
this.succeed = true; this.succeed = true;
this.session.setSuccess(true);
onCompleted();
break; break;
case TRANSFER_FAILED_EVENT: case TRANSFER_FAILED_EVENT:
fail = true; fail = true;
this.session.setFail(true);
onFail();
break; break;
default: default:
break; break;
} }
//控制台打印进度 //控制台打印进度
log.info("upload process id:{}, percent:{}", session.getId(), percent); this.session.setProcess(percent + " %");
//System.out.println("percent:" + percent); //System.out.println("percent:" + percent);
} }

6
ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutProcessData.java

@ -1,10 +1,12 @@
package com.ruoyi.web.controller.ilisteners; package com.ruoyi.framework.web.ilisteners;
import lombok.Data; import lombok.Data;
@Data @Data
public class PutProcessData { public class PutProcessData {
private Long id; private String id;
private String process; private String process;
private boolean success=false;
private boolean fail=false;
} }

119
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AliOSSService.java

@ -1,2 +1,119 @@
package com.ruoyi.system.service;public class AliOSSService { package com.ruoyi.framework.web.service;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.PutObjectRequest;
import com.aliyun.oss.model.PutObjectResult;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.framework.web.ilisteners.PutObjectProgressListener;
import com.ruoyi.framework.web.ilisteners.PutProcessData;
import com.ruoyi.system.domain.BFile;
import com.ruoyi.system.service.IBFileService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.util.UUID;
@Data
@Slf4j
@Service
public class AliOSSService {
@Value("${ali.oss.endpoint}")
private String endpoint = "yourEndpoint";
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
@Value("${ali.oss.accessKey}")
private String accessKeyId = "yourAccessKeyId";
@Value("${ali.oss.secret}")
private String accessKeySecret = "yourAccessKeySecret";
//阿里云BucketName
@Value("${ali.oss.bucketName}")
private String bucketName;
//阿里云绑定的域名
@Value("${ali.oss.domain}")
private String domain;
//阿里云路径前缀
@Value("${ali.oss.prefix}")
private String prefix;
public OSS newOss() {
log.info("new oss accessKeyId:{}", accessKeyId);
return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
}
public void remove(OSS client, String objectName, String path) {
if (client.doesObjectExist(objectName, path)){
client.deleteObject(bucketName, path);
}
}
public String upload(OSS client, InputStream inputStream, String path) {
try {
client.putObject(bucketName, path, inputStream);
} catch (Exception e) {
throw new BaseException("上传文件失败,请检查配置信息");
}
return domain + "/" + path;
}
public String upload(OSS client, PutProcessData processData , String fileName, File f, String path, IBFileService bFileService, BFile bile) {
try {
/*PutObjectResult putObjectResult=client.putObject(bucketName, path, inputStream);*/
client
.putObject(new PutObjectRequest(bucketName,
path, f)
.<PutObjectRequest> withProgressListener(
new PutObjectProgressListener(processData,bFileService,bile)
));
} catch (Exception e) {
throw new BaseException("上传文件失败,请检查配置信息");
}
return domain + "/" + path;
}
public String uploadSuffix(OSS client, PutProcessData processData , String fileName, File f, String suffix,IBFileService bFileService, BFile bile) {
return upload(client, processData, fileName, f, getPath(getPrefix(), suffix),bFileService,bile);
}
public String uploadSuffix(OSS client, byte[] data, String suffix) {
return upload(client, new ByteArrayInputStream(data), getPath(getPrefix(), suffix));
}
public String uploadSuffix(OSS client, InputStream inputStream, String suffix) {
return upload(client, inputStream, getPath(getPrefix(), suffix));
}
public String getPath(String prefix, String suffix) {
//生成uuid
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
//文件路径
String path = DateUtil.today().replaceAll("-", "");
if (StrUtil.isNotBlank(prefix)) {
path = prefix + "/" + path;
}
return path + suffix;
}
} }

60
ruoyi-system/src/main/java/com/ruoyi/system/domain/BFile.java

@ -11,7 +11,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 请填写功能名称对象 b_file * 请填写功能名称对象 b_file
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-14
*/ */
public class BFile extends BaseEntity public class BFile extends BaseEntity
{ {
@ -20,9 +20,9 @@ public class BFile extends BaseEntity
/** $column.columnComment */ /** $column.columnComment */
private Long id; private Long id;
/** 文件id */ /** 视频名称 */
@Excel(name = "文件id") @Excel(name = "视频名称")
private String uuid; private String videoName;
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
@ -32,6 +32,18 @@ public class BFile extends BaseEntity
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date gmtCreate; private Date gmtCreate;
/** 文件id */
@Excel(name = "文件id")
private String uuid;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String percent;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long done;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -41,14 +53,14 @@ public class BFile extends BaseEntity
{ {
return id; return id;
} }
public void setUuid(String uuid) public void setVideoName(String videoName)
{ {
this.uuid = uuid; this.videoName = videoName;
} }
public String getUuid() public String getVideoName()
{ {
return uuid; return videoName;
} }
public void setMemo(String memo) public void setMemo(String memo)
{ {
@ -68,14 +80,44 @@ public class BFile extends BaseEntity
{ {
return gmtCreate; return gmtCreate;
} }
public void setUuid(String uuid)
{
this.uuid = uuid;
}
public String getUuid()
{
return uuid;
}
public void setPercent(String percent)
{
this.percent = percent;
}
public String getPercent()
{
return percent;
}
public void setDone(Long done)
{
this.done = done;
}
public Long getDone()
{
return done;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("uuid", getUuid()) .append("videoName", getVideoName())
.append("memo", getMemo()) .append("memo", getMemo())
.append("gmtCreate", getGmtCreate()) .append("gmtCreate", getGmtCreate())
.append("uuid", getUuid())
.append("percent", getPercent())
.append("done", getDone())
.toString(); .toString();
} }
} }

44
ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideoAllow.java

@ -11,7 +11,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 允许列对象 b_video_allow * 允许列对象 b_video_allow
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-10
*/ */
public class BVideoAllow extends BaseEntity public class BVideoAllow extends BaseEntity
{ {
@ -32,13 +32,21 @@ public class BVideoAllow extends BaseEntity
@Excel(name = "微信公众号昵称") @Excel(name = "微信公众号昵称")
private String wxNickname; private String wxNickname;
/** 备注 */
@Excel(name = "备注")
private String memo;
/** 分享链接 */
@Excel(name = "分享链接")
private String link;
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date gmtCreate; private Long videoId;
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long videoId; private Date gmtCreate;
public void setId(Long id) public void setId(Long id)
{ {
@ -76,14 +84,23 @@ public class BVideoAllow extends BaseEntity
{ {
return wxNickname; return wxNickname;
} }
public void setGmtCreate(Date gmtCreate) public void setMemo(String memo)
{ {
this.gmtCreate = gmtCreate; this.memo = memo;
} }
public Date getGmtCreate() public String getMemo()
{ {
return gmtCreate; return memo;
}
public void setLink(String link)
{
this.link = link;
}
public String getLink()
{
return link;
} }
public void setVideoId(Long videoId) public void setVideoId(Long videoId)
{ {
@ -94,6 +111,15 @@ public class BVideoAllow extends BaseEntity
{ {
return videoId; return videoId;
} }
public void setGmtCreate(Date gmtCreate)
{
this.gmtCreate = gmtCreate;
}
public Date getGmtCreate()
{
return gmtCreate;
}
@Override @Override
public String toString() { public String toString() {
@ -102,8 +128,10 @@ public class BVideoAllow extends BaseEntity
.append("allowId", getAllowId()) .append("allowId", getAllowId())
.append("wxOpenid", getWxOpenid()) .append("wxOpenid", getWxOpenid())
.append("wxNickname", getWxNickname()) .append("wxNickname", getWxNickname())
.append("gmtCreate", getGmtCreate()) .append("memo", getMemo())
.append("link", getLink())
.append("videoId", getVideoId()) .append("videoId", getVideoId())
.append("gmtCreate", getGmtCreate())
.toString(); .toString();
} }
} }

2
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BFileMapper.java

@ -7,7 +7,7 @@ import com.ruoyi.system.domain.BFile;
* 请填写功能名称Mapper接口 * 请填写功能名称Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-14
*/ */
public interface BFileMapper public interface BFileMapper
{ {

2
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideoAllowMapper.java

@ -7,7 +7,7 @@ import com.ruoyi.system.domain.BVideoAllow;
* 允许列Mapper接口 * 允许列Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-10
*/ */
public interface BVideoAllowMapper public interface BVideoAllowMapper
{ {

2
ruoyi-system/src/main/java/com/ruoyi/system/service/IBFileService.java

@ -7,7 +7,7 @@ import com.ruoyi.system.domain.BFile;
* 请填写功能名称Service接口 * 请填写功能名称Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-14
*/ */
public interface IBFileService public interface IBFileService
{ {

2
ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideoAllowService.java

@ -7,7 +7,7 @@ import com.ruoyi.system.domain.BVideoAllow;
* 允许列Service接口 * 允许列Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-10
*/ */
public interface IBVideoAllowService public interface IBVideoAllowService
{ {

2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BFileServiceImpl.java

@ -11,7 +11,7 @@ import com.ruoyi.system.service.IBFileService;
* 请填写功能名称Service业务层处理 * 请填写功能名称Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-14
*/ */
@Service @Service
public class BFileServiceImpl implements IBFileService public class BFileServiceImpl implements IBFileService

2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideoAllowServiceImpl.java

@ -11,7 +11,7 @@ import com.ruoyi.system.service.IBVideoAllowService;
* 允许列Service业务层处理 * 允许列Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2022-03-09 * @date 2022-03-10
*/ */
@Service @Service
public class BVideoAllowServiceImpl implements IBVideoAllowService public class BVideoAllowServiceImpl implements IBVideoAllowService

27
ruoyi-system/src/main/resources/mapper/system/BFileMapper.xml

@ -6,21 +6,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BFile" id="BFileResult"> <resultMap type="BFile" id="BFileResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="uuid" column="uuid" /> <result property="videoName" column="video_name" />
<result property="memo" column="memo" /> <result property="memo" column="memo" />
<result property="gmtCreate" column="gmt_create" /> <result property="gmtCreate" column="gmt_create" />
<result property="uuid" column="uuid" />
<result property="percent" column="percent" />
<result property="done" column="done" />
</resultMap> </resultMap>
<sql id="selectBFileVo"> <sql id="selectBFileVo">
select id, uuid, memo, gmt_create from b_file select id, video_name, memo, gmt_create, uuid, percent, done from b_file
</sql> </sql>
<select id="selectBFileList" parameterType="BFile" resultMap="BFileResult"> <select id="selectBFileList" parameterType="BFile" resultMap="BFileResult">
<include refid="selectBFileVo"/> <include refid="selectBFileVo"/>
<where> <where>
<if test="uuid != null and uuid != ''"> and uuid = #{uuid}</if> <if test="videoName != null and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if>
<if test="memo != null and memo != ''"> and memo = #{memo}</if> <if test="memo != null and memo != ''"> and memo = #{memo}</if>
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if> <if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if>
<if test="uuid != null and uuid != ''"> and uuid = #{uuid}</if>
<if test="percent != null and percent != ''"> and percent = #{percent}</if>
<if test="done != null "> and done = #{done}</if>
</where> </where>
</select> </select>
@ -32,23 +38,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertBFile" parameterType="BFile" useGeneratedKeys="true" keyProperty="id"> <insert id="insertBFile" parameterType="BFile" useGeneratedKeys="true" keyProperty="id">
insert into b_file insert into b_file
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uuid != null">uuid,</if> <if test="videoName != null">video_name,</if>
<if test="memo != null">memo,</if> <if test="memo != null">memo,</if>
<if test="gmtCreate != null">gmt_create,</if> <if test="gmtCreate != null">gmt_create,</if>
<if test="uuid != null">uuid,</if>
<if test="percent != null">percent,</if>
<if test="done != null">done,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uuid != null">#{uuid},</if> <if test="videoName != null">#{videoName},</if>
<if test="memo != null">#{memo},</if> <if test="memo != null">#{memo},</if>
<if test="gmtCreate != null">#{gmtCreate},</if> <if test="gmtCreate != null">#{gmtCreate},</if>
<if test="uuid != null">#{uuid},</if>
<if test="percent != null">#{percent},</if>
<if test="done != null">#{done},</if>
</trim> </trim>
</insert> </insert>
<update id="updateBFile" parameterType="BFile"> <update id="updateBFile" parameterType="BFile">
update b_file update b_file
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="uuid != null">uuid = #{uuid},</if> <if test="videoName != null">video_name = #{videoName},</if>
<if test="memo != null">memo = #{memo},</if> <if test="memo != null">memo = #{memo},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if> <if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="uuid != null">uuid = #{uuid},</if>
<if test="percent != null">percent = #{percent},</if>
<if test="done != null">done = #{done},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

22
ruoyi-system/src/main/resources/mapper/system/BVideoAllowMapper.xml

@ -9,12 +9,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="allowId" column="allow_id" /> <result property="allowId" column="allow_id" />
<result property="wxOpenid" column="wx_openid" /> <result property="wxOpenid" column="wx_openid" />
<result property="wxNickname" column="wx_nickname" /> <result property="wxNickname" column="wx_nickname" />
<result property="gmtCreate" column="gmt_create" /> <result property="memo" column="memo" />
<result property="link" column="link" />
<result property="videoId" column="video_id" /> <result property="videoId" column="video_id" />
<result property="gmtCreate" column="gmt_create" />
</resultMap> </resultMap>
<sql id="selectBVideoAllowVo"> <sql id="selectBVideoAllowVo">
select id, allow_id, wx_openid, wx_nickname, gmt_create, video_id from b_video_allow select id, allow_id, wx_openid, wx_nickname, memo, link, video_id, gmt_create from b_video_allow
</sql> </sql>
<select id="selectBVideoAllowList" parameterType="BVideoAllow" resultMap="BVideoAllowResult"> <select id="selectBVideoAllowList" parameterType="BVideoAllow" resultMap="BVideoAllowResult">
@ -23,8 +25,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="allowId != null and allowId != ''"> and allow_id = #{allowId}</if> <if test="allowId != null and allowId != ''"> and allow_id = #{allowId}</if>
<if test="wxOpenid != null and wxOpenid != ''"> and wx_openid = #{wxOpenid}</if> <if test="wxOpenid != null and wxOpenid != ''"> and wx_openid = #{wxOpenid}</if>
<if test="wxNickname != null and wxNickname != ''"> and wx_nickname like concat('%', #{wxNickname}, '%')</if> <if test="wxNickname != null and wxNickname != ''"> and wx_nickname like concat('%', #{wxNickname}, '%')</if>
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if> <if test="memo != null and memo != ''"> and memo = #{memo}</if>
<if test="link != null and link != ''"> and link = #{link}</if>
<if test="videoId != null "> and video_id = #{videoId}</if> <if test="videoId != null "> and video_id = #{videoId}</if>
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if>
</where> </where>
</select> </select>
@ -39,15 +43,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="allowId != null">allow_id,</if> <if test="allowId != null">allow_id,</if>
<if test="wxOpenid != null">wx_openid,</if> <if test="wxOpenid != null">wx_openid,</if>
<if test="wxNickname != null">wx_nickname,</if> <if test="wxNickname != null">wx_nickname,</if>
<if test="gmtCreate != null">gmt_create,</if> <if test="memo != null">memo,</if>
<if test="link != null">link,</if>
<if test="videoId != null">video_id,</if> <if test="videoId != null">video_id,</if>
<if test="gmtCreate != null">gmt_create,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="allowId != null">#{allowId},</if> <if test="allowId != null">#{allowId},</if>
<if test="wxOpenid != null">#{wxOpenid},</if> <if test="wxOpenid != null">#{wxOpenid},</if>
<if test="wxNickname != null">#{wxNickname},</if> <if test="wxNickname != null">#{wxNickname},</if>
<if test="gmtCreate != null">#{gmtCreate},</if> <if test="memo != null">#{memo},</if>
<if test="link != null">#{link},</if>
<if test="videoId != null">#{videoId},</if> <if test="videoId != null">#{videoId},</if>
<if test="gmtCreate != null">#{gmtCreate},</if>
</trim> </trim>
</insert> </insert>
@ -57,8 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="allowId != null">allow_id = #{allowId},</if> <if test="allowId != null">allow_id = #{allowId},</if>
<if test="wxOpenid != null">wx_openid = #{wxOpenid},</if> <if test="wxOpenid != null">wx_openid = #{wxOpenid},</if>
<if test="wxNickname != null">wx_nickname = #{wxNickname},</if> <if test="wxNickname != null">wx_nickname = #{wxNickname},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if> <if test="memo != null">memo = #{memo},</if>
<if test="link != null">link = #{link},</if>
<if test="videoId != null">video_id = #{videoId},</if> <if test="videoId != null">video_id = #{videoId},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

16
ruoyi-ui/.env.production

@ -1,8 +1,8 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 若依管理系统
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'
# 若依管理系统/生产环境 # 若依管理系统/生产环境
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = 'http://106.15.102.28:8080'

20
ruoyi-ui/.env.staging

@ -1,10 +1,10 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 若依管理系统
NODE_ENV = production NODE_ENV = production
# 测试环境配置 # 测试环境配置
ENV = 'staging' ENV = 'staging'
# 若依管理系统/测试环境 # 若依管理系统/测试环境
VUE_APP_BASE_API = '/stage-api' VUE_APP_BASE_API = 'http://106.15.102.28:8080'

180
ruoyi-ui/package.json

@ -1,90 +1,90 @@
{ {
"name": "ruoyi", "name": "ruoyi",
"version": "3.8.1", "version": "3.8.1",
"description": "若依管理系统", "description": "若依管理系统",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src" "lint": "eslint --ext .js,.vue src"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "lint-staged" "pre-commit": "lint-staged"
} }
}, },
"lint-staged": { "lint-staged": {
"src/**/*.{js,vue}": [ "src/**/*.{js,vue}": [
"eslint --fix", "eslint --fix",
"git add" "git add"
] ]
}, },
"keywords": [ "keywords": [
"vue", "vue",
"admin", "admin",
"dashboard", "dashboard",
"element-ui", "element-ui",
"boilerplate", "boilerplate",
"admin-template", "admin-template",
"management-system" "management-system"
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://gitee.com/y_project/RuoYi-Vue.git" "url": "https://gitee.com/y_project/RuoYi-Vue.git"
}, },
"dependencies": { "dependencies": {
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"axios": "0.24.0", "axios": "0.24.0",
"clipboard": "2.0.8", "clipboard": "2.0.8",
"core-js": "3.19.1", "core-js": "3.19.1",
"echarts": "4.9.0", "echarts": "4.9.0",
"element-ui": "2.15.6", "element-ui": "2.15.6",
"file-saver": "2.0.5", "file-saver": "2.0.5",
"fuse.js": "6.4.3", "fuse.js": "6.4.3",
"highlight.js": "9.18.5", "highlight.js": "9.18.5",
"js-beautify": "1.13.0", "js-beautify": "1.13.0",
"js-cookie": "3.0.1", "js-cookie": "3.0.1",
"jsencrypt": "3.2.1", "jsencrypt": "3.2.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",
"sortablejs": "1.10.2", "sortablejs": "1.10.2",
"vue": "2.6.12", "vue": "2.6.12",
"vue-count-to": "1.0.13", "vue-count-to": "1.0.13",
"vue-cropper": "0.5.5", "vue-cropper": "0.5.5",
"vue-meta": "2.4.0", "vue-meta": "2.4.0",
"vue-router": "3.4.9", "vue-router": "3.4.9",
"vuedraggable": "2.24.3", "vuedraggable": "2.24.3",
"vuex": "3.6.0" "vuex": "3.6.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "4.4.6", "@vue/cli-plugin-babel": "4.4.6",
"@vue/cli-plugin-eslint": "4.4.6", "@vue/cli-plugin-eslint": "4.4.6",
"@vue/cli-service": "4.4.6", "@vue/cli-service": "4.4.6",
"babel-eslint": "10.1.0", "babel-eslint": "10.1.0",
"babel-plugin-dynamic-import-node": "2.3.3", "babel-plugin-dynamic-import-node": "2.3.3",
"chalk": "4.1.0", "chalk": "4.1.0",
"compression-webpack-plugin": "5.0.2", "compression-webpack-plugin": "5.0.2",
"connect": "3.6.6", "connect": "3.6.6",
"eslint": "7.15.0", "eslint": "7.15.0",
"eslint-plugin-vue": "7.2.0", "eslint-plugin-vue": "7.2.0",
"lint-staged": "10.5.3", "lint-staged": "10.5.3",
"runjs": "4.4.2", "runjs": "4.4.2",
"sass": "1.32.13", "sass": "1.32.13",
"sass-loader": "10.1.1", "sass-loader": "10.1.1",
"script-ext-html-webpack-plugin": "2.1.5", "script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1", "svg-sprite-loader": "5.1.1",
"vue-template-compiler": "2.6.12" "vue-template-compiler": "2.6.12"
}, },
"engines": { "engines": {
"node": ">=8.9", "node": ">=8.9",
"npm": ">= 3.0.0" "npm": ">= 3.0.0"
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
] ]
} }

417
ruoyi-ui/public/index.html

@ -1,208 +1,209 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style> <style>
html, html,
body, body,
#app { #app {
height: 100%; height: 100%;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
.chromeframe { .chromeframe {
margin: 0.2em 0; margin: 0.2em 0;
background: #ccc; background: #ccc;
color: #000; color: #000;
padding: 0.2em 0; padding: 0.2em 0;
} }
#loader-wrapper { #loader-wrapper {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 999999; z-index: 999999;
} }
#loader { #loader {
display: block; display: block;
position: relative; position: relative;
left: 50%; left: 50%;
top: 50%; top: 50%;
width: 150px; width: 150px;
height: 150px; height: 150px;
margin: -75px 0 0 -75px; margin: -75px 0 0 -75px;
border-radius: 50%; border-radius: 50%;
border: 3px solid transparent; border: 3px solid transparent;
border-top-color: #FFF; border-top-color: #FFF;
-webkit-animation: spin 2s linear infinite; -webkit-animation: spin 2s linear infinite;
-ms-animation: spin 2s linear infinite; -ms-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite; -moz-animation: spin 2s linear infinite;
-o-animation: spin 2s linear infinite; -o-animation: spin 2s linear infinite;
animation: spin 2s linear infinite; animation: spin 2s linear infinite;
z-index: 1001; z-index: 1001;
} }
#loader:before { #loader:before {
content: ""; content: "";
position: absolute; position: absolute;
top: 5px; top: 5px;
left: 5px; left: 5px;
right: 5px; right: 5px;
bottom: 5px; bottom: 5px;
border-radius: 50%; border-radius: 50%;
border: 3px solid transparent; border: 3px solid transparent;
border-top-color: #FFF; border-top-color: #FFF;
-webkit-animation: spin 3s linear infinite; -webkit-animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite; -moz-animation: spin 3s linear infinite;
-o-animation: spin 3s linear infinite; -o-animation: spin 3s linear infinite;
-ms-animation: spin 3s linear infinite; -ms-animation: spin 3s linear infinite;
animation: spin 3s linear infinite; animation: spin 3s linear infinite;
} }
#loader:after { #loader:after {
content: ""; content: "";
position: absolute; position: absolute;
top: 15px; top: 15px;
left: 15px; left: 15px;
right: 15px; right: 15px;
bottom: 15px; bottom: 15px;
border-radius: 50%; border-radius: 50%;
border: 3px solid transparent; border: 3px solid transparent;
border-top-color: #FFF; border-top-color: #FFF;
-moz-animation: spin 1.5s linear infinite; -moz-animation: spin 1.5s linear infinite;
-o-animation: spin 1.5s linear infinite; -o-animation: spin 1.5s linear infinite;
-ms-animation: spin 1.5s linear infinite; -ms-animation: spin 1.5s linear infinite;
-webkit-animation: spin 1.5s linear infinite; -webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite; animation: spin 1.5s linear infinite;
} }
@-webkit-keyframes spin { @-webkit-keyframes spin {
0% { 0% {
-webkit-transform: rotate(0deg); -webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg); -ms-transform: rotate(0deg);
transform: rotate(0deg); transform: rotate(0deg);
} }
100% { 100% {
-webkit-transform: rotate(360deg); -webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg); -ms-transform: rotate(360deg);
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
@keyframes spin { @keyframes spin {
0% { 0% {
-webkit-transform: rotate(0deg); -webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg); -ms-transform: rotate(0deg);
transform: rotate(0deg); transform: rotate(0deg);
} }
100% { 100% {
-webkit-transform: rotate(360deg); -webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg); -ms-transform: rotate(360deg);
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
#loader-wrapper .loader-section { #loader-wrapper .loader-section {
position: fixed; position: fixed;
top: 0; top: 0;
width: 51%; width: 51%;
height: 100%; height: 100%;
background: #7171C6; background: #7171C6;
z-index: 1000; z-index: 1000;
-webkit-transform: translateX(0); -webkit-transform: translateX(0);
-ms-transform: translateX(0); -ms-transform: translateX(0);
transform: translateX(0); transform: translateX(0);
} }
#loader-wrapper .loader-section.section-left { #loader-wrapper .loader-section.section-left {
left: 0; left: 0;
} }
#loader-wrapper .loader-section.section-right { #loader-wrapper .loader-section.section-right {
right: 0; right: 0;
} }
.loaded #loader-wrapper .loader-section.section-left { .loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%); -webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%); -ms-transform: translateX(-100%);
transform: translateX(-100%); transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
} }
.loaded #loader-wrapper .loader-section.section-right { .loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%); -webkit-transform: translateX(100%);
-ms-transform: translateX(100%); -ms-transform: translateX(100%);
transform: translateX(100%); transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
} }
.loaded #loader { .loaded #loader {
opacity: 0; opacity: 0;
-webkit-transition: all 0.3s ease-out; -webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out; transition: all 0.3s ease-out;
} }
.loaded #loader-wrapper { .loaded #loader-wrapper {
visibility: hidden; visibility: hidden;
-webkit-transform: translateY(-100%); -webkit-transform: translateY(-100%);
-ms-transform: translateY(-100%); -ms-transform: translateY(-100%);
transform: translateY(-100%); transform: translateY(-100%);
-webkit-transition: all 0.3s 1s ease-out; -webkit-transition: all 0.3s 1s ease-out;
transition: all 0.3s 1s ease-out; transition: all 0.3s 1s ease-out;
} }
.no-js #loader-wrapper { .no-js #loader-wrapper {
display: none; display: none;
} }
.no-js h1 { .no-js h1 {
color: #222222; color: #222222;
} }
#loader-wrapper .load_title { #loader-wrapper .load_title {
font-family: 'Open Sans'; font-family: 'Open Sans';
color: #FFF; color: #FFF;
font-size: 19px; font-size: 19px;
width: 100%; width: 100%;
text-align: center; text-align: center;
z-index: 9999999999999; z-index: 9999999999999;
position: absolute; position: absolute;
top: 60%; top: 60%;
opacity: 1; opacity: 1;
line-height: 30px; line-height: 30px;
} }
#loader-wrapper .load_title span { #loader-wrapper .load_title span {
font-weight: normal; font-weight: normal;
font-style: italic; font-style: italic;
font-size: 13px; font-size: 13px;
color: #FFF; color: #FFF;
opacity: 0.5; opacity: 0.5;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<div id="loader-wrapper"> <div id="loader-wrapper">
<div id="loader"></div> <div id="loader"></div>
<div class="loader-section section-left"></div> <div class="loader-section section-left"></div>
<div class="loader-section section-right"></div> <div class="loader-section section-right"></div>
<div class="load_title">正在加载系统资源,请耐心等待</div> <div class="load_title">正在加载系统资源,请耐心等待</div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

18
ruoyi-ui/src/api/system/file.js

@ -3,7 +3,15 @@ import request from '@/utils/request'
// 查询【请填写功能名称】列表 // 查询【请填写功能名称】列表
export function listFile(query) { export function listFile(query) {
return request({ return request({
url: '/system/file/list', url: '/videos/file/list',
method: 'get',
params: query
})
}
// 未被选中的列表
export function getNoAuthFiles(query) {
return request({
url: '/videos/file/getNoAuthFiles',
method: 'get', method: 'get',
params: query params: query
}) })
@ -12,7 +20,7 @@ export function listFile(query) {
// 查询【请填写功能名称】详细 // 查询【请填写功能名称】详细
export function getFile(id) { export function getFile(id) {
return request({ return request({
url: '/system/file/' + id, url: '/videos/file/' + id,
method: 'get' method: 'get'
}) })
} }
@ -20,7 +28,7 @@ export function getFile(id) {
// 新增【请填写功能名称】 // 新增【请填写功能名称】
export function addFile(data) { export function addFile(data) {
return request({ return request({
url: '/system/file', url: '/videos/file',
method: 'post', method: 'post',
data: data data: data
}) })
@ -29,7 +37,7 @@ export function addFile(data) {
// 修改【请填写功能名称】 // 修改【请填写功能名称】
export function updateFile(data) { export function updateFile(data) {
return request({ return request({
url: '/system/file', url: '/videos/file',
method: 'put', method: 'put',
data: data data: data
}) })
@ -38,7 +46,7 @@ export function updateFile(data) {
// 删除【请填写功能名称】 // 删除【请填写功能名称】
export function delFile(id) { export function delFile(id) {
return request({ return request({
url: '/system/file/' + id, url: '/videos/file/' + id,
method: 'delete' method: 'delete'
}) })
} }

8
ruoyi-ui/src/api/system/videos.js

@ -25,6 +25,14 @@ export function addVideos(data) {
data: data data: data
}) })
} }
// 给分享链接
export function addShareFile(data) {
return request({
url: '/system/videos/insertVideos',
method: 'post',
data: data
})
}
// 修改视频信息 // 修改视频信息
export function updateVideos(data) { export function updateVideos(data) {

28
ruoyi-ui/src/router/index.js

@ -120,6 +120,34 @@ export const dynamicRoutes = [
} }
] ]
}, },
{
path: '/system/manage',
component: Layout,
hidden: true,
permissions: ['system:videos:manage'],
children: [
{
path: 'user/:videoId(\\d+)',
component: () => import('@/views/system/manage/files'),
name: 'AuthUser',
meta: { }
}
]
},
{
path: '/system/allow',
component: Layout,
hidden: true,
permissions: ['system:videos:manage'],
children: [
{
path: 'user/:videoId(\\d+)',
component: () => import('@/views/system/allow/index'),
name: 'AuthUser',
meta: { }
}
]
},
{ {
path: '/system/dict-data', path: '/system/dict-data',
component: Layout, component: Layout,

144
ruoyi-ui/src/views/system/allow/index.vue

@ -1,42 +1,11 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="${comment}" prop="allowId">
<el-input <el-form-item label="备注" prop="memo">
v-model="queryParams.allowId"
placeholder="请输入${comment}"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="公众号openid" prop="wxOpenid">
<el-input
v-model="queryParams.wxOpenid"
placeholder="请输入公众号openid"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="微信公众号昵称" prop="wxNickname">
<el-input
v-model="queryParams.wxNickname"
placeholder="请输入微信公众号昵称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="${comment}" prop="gmtCreate">
<el-date-picker clearable
v-model="queryParams.gmtCreate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="videoId">
<el-input <el-input
v-model="queryParams.videoId" v-model="queryParams.memo"
placeholder="请输入${comment}" placeholder="请输入备注"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -56,7 +25,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:allow:add']" v-hasPermi="['system:allow:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -67,7 +37,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:allow:edit']" v-hasPermi="['system:allow:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -78,7 +49,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:allow:remove']" v-hasPermi="['system:allow:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -88,23 +60,33 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:allow:export']" v-hasPermi="['system:allow:export']"
>导出</el-button> >导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="allowList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="allowList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="${comment}" align="center" prop="id" /> <el-table-column label="id" align="center" prop="id"/>
<el-table-column label="${comment}" align="center" prop="allowId" /> <el-table-column label="公众号openid" align="center" prop="wxOpenid"/>
<el-table-column label="公众号openid" align="center" prop="wxOpenid" /> <el-table-column label="微信公众号昵称" align="center" prop="wxNickname"/>
<el-table-column label="微信公众号昵称" align="center" prop="wxNickname" /> <el-table-column label="备注" align="center" prop="memo"/>
<el-table-column label="${comment}" align="center" prop="gmtCreate" width="180"> <el-table-column label="分享链接" align="center" prop="allowId">
<template slot-scope="scope">
<el-button
v-clipboard:copy="clipboardLink(scope.row.link)"
v-clipboard:success="clipboardLinkOk"
v-clipboard:error="clipboardLinkFail"
>复制
</el-button>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="gmtCreate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="${comment}" align="center" prop="videoId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -113,18 +95,20 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:allow:edit']" v-hasPermi="['system:allow:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:allow:remove']" v-hasPermi="['system:allow:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -136,25 +120,8 @@
<!-- 添加或修改允许列对话框 --> <!-- 添加或修改允许列对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="${comment}" prop="allowId"> <el-form-item label="备注" prop="memo">
<el-input v-model="form.allowId" placeholder="请输入${comment}" /> <el-input v-model="form.memo" placeholder="请输入备注"/>
</el-form-item>
<el-form-item label="公众号openid" prop="wxOpenid">
<el-input v-model="form.wxOpenid" placeholder="请输入公众号openid" />
</el-form-item>
<el-form-item label="微信公众号昵称" prop="wxNickname">
<el-input v-model="form.wxNickname" placeholder="请输入微信公众号昵称" />
</el-form-item>
<el-form-item label="${comment}" prop="gmtCreate">
<el-date-picker clearable
v-model="form.gmtCreate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="videoId">
<el-input v-model="form.videoId" placeholder="请输入${comment}" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -166,7 +133,8 @@
</template> </template>
<script> <script>
import { listAllow, getAllow, delAllow, addAllow, updateAllow } from "@/api/system/allow"; import Clipboard from "clipboard";
import {listAllow, getAllow, delAllow, addAllow, updateAllow} from "@/api/system/allow";
export default { export default {
name: "Allow", name: "Allow",
@ -197,17 +165,20 @@ export default {
allowId: null, allowId: null,
wxOpenid: null, wxOpenid: null,
wxNickname: null, wxNickname: null,
gmtCreate: null, memo: null,
videoId: null link: null,
videoId: null,
gmtCreate: null
}, },
// //
form: {}, form: {},
// //
rules: { rules: {}
}
}; };
}, },
created() { created() {
const videoId = this.$route.params && this.$route.params.videoId;
this.queryParams.videoId = videoId
this.getList(); this.getList();
}, },
methods: { methods: {
@ -232,11 +203,25 @@ export default {
allowId: null, allowId: null,
wxOpenid: null, wxOpenid: null,
wxNickname: null, wxNickname: null,
gmtCreate: null, memo: null,
videoId: null link: null,
videoId: null,
gmtCreate: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },
clipboardLink(link) {
return link;
},
clipboardLinkOk(link) {
this.$modal.msgSuccess("已复制" + link);
},
clipboardLinkFail(link) {
//this.$modal.msgError("");
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -250,7 +235,7 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
@ -271,6 +256,8 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
const videoId = this.$route.params && this.$route.params.videoId;
this.form.videoId = videoId
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
@ -292,12 +279,13 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除允许列编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除允许列编号为"' + ids + '"的数据项?').then(function () {
return delAllow(ids); return delAllow(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {

212
ruoyi-ui/src/views/system/file/index.vue

@ -17,14 +17,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="${comment}" prop="gmtCreate">
<el-date-picker clearable
v-model="queryParams.gmtCreate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -40,18 +33,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:file:add']" v-hasPermi="['system:file:add']"
>新增</el-button> >新增
</el-col> </el-button>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:file:edit']"
>修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -62,7 +45,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:file:remove']" v-hasPermi="['system:file:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -72,17 +56,20 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:file:export']" v-hasPermi="['system:file:export']"
>导出</el-button> >导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="fileList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="fileList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="${comment}" align="center" prop="id" /> <el-table-column label="文件id" align="center" prop="uuid"/>
<el-table-column label="文件id" align="center" prop="uuid" /> <el-table-column label="视频名称" align="center" prop="videoName"/>
<el-table-column label="备注" align="center" prop="memo" /> <el-table-column label="阿里上传百分比" align="center" prop="percent"/>
<el-table-column label="${comment}" align="center" prop="gmtCreate" width="180"> <el-table-column label="阿里上传状态 1:成功,0:初始化,2:失败,3:上传中" align="center" prop="done"/>
<el-table-column label="备注" align="center" prop="memo"/>
<el-table-column label="创建时间" align="center" prop="gmtCreate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span>
</template> </template>
@ -95,18 +82,20 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:file:edit']" v-hasPermi="['system:file:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:file:remove']" v-hasPermi="['system:file:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -116,38 +105,83 @@
/> />
<!-- 添加或修改请填写功能名称对话框 --> <!-- 添加或修改请填写功能名称对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <!-- <el-dialog :title="title" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文件id" prop="uuid">
<el-input v-model="form.uuid" placeholder="请输入文件id" /> <el-form-item label="备注" prop="memo">
</el-form-item> <el-input v-model="form.memo" placeholder="请输入备注" />
<el-form-item label="备注" prop="memo"> </el-form-item>
<el-input v-model="form.memo" placeholder="请输入备注" />
</el-form-item> </el-form>
<el-form-item label="${comment}" prop="gmtCreate"> <div slot="footer" class="dialog-footer">
<el-date-picker clearable <el-button type="primary" @click="submitForm"> </el-button>
v-model="form.gmtCreate" <el-button @click="cancel"> </el-button>
type="date" </div>
value-format="yyyy-MM-dd" </el-dialog>-->
placeholder="请选择${comment}"> <!-- 用户导入对话框 -->
</el-date-picker> <el-dialog v-loading="uploadLoading" :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
</el-form-item> <el-upload
</el-form> ref="upload"
:limit="1"
accept="*.*"
:headers="upload.headers"
:action="upload.url + '?remark=' + upload.updateSupport+'&videoName=' + upload.fileName"
:disabled="upload.isUploading"
:on-change="fileChange"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
视频名称<el-input v-model="upload.fileName" />
</div>
<div class="el-upload__tip" slot="tip">
备注<el-input v-model="upload.updateSupport" />
</div>
<!-- <span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>-->
</div>
</el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" :disabled="btnChangeEnable" @click="submitFileForm">{{sureName}}</el-button>
<el-button @click="cancel"> </el-button> <el-button @click="upload.open = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listFile, getFile, delFile, addFile, updateFile } from "@/api/system/file"; import {listFile, getFile, delFile, addFile, updateFile} from "@/api/system/file";
import { getToken } from "@/utils/auth";
export default { export default {
inheritAttrs: false,
name: "File", name: "File",
data() { data() {
return { return {
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: '',
fileName: '',
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/videos/file/addFile"
},
//
btnChangeEnable:false,
sureName:"确 定",
uploadLoading:true,
// //
loading: true, loading: true,
// //
@ -178,11 +212,15 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
} }
}; };
}, },
created() { created() {
this.getList(); this.getList();
/*setInterval(function (){
this.getList()
},5000)*/
}, },
methods: { methods: {
/** 查询【请填写功能名称】列表 */ /** 查询【请填写功能名称】列表 */
@ -194,6 +232,9 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
onOpen(){
return false
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -201,13 +242,15 @@ export default {
}, },
// //
reset() { reset() {
this.form = { this.upload.fileName=''
id: null, this.btnChangeEnable=false
uuid: null, this.sureName="确 定"
memo: null, this.formData = {
gmtCreate: null field101: null,
}; field102: undefined,
}
this.resetForm("form"); this.resetForm("form");
this.resetForm("elForm");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -222,14 +265,54 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
onClose() {
},
close() {
this.$emit('update:visible', false)
},
handleConfirm() {
console.log(this.fileList.length)
console.log(this.formData.field102)
this.$refs['elForm'].validate(valid => {
if (!valid) return
this.close()
})
},
//
fileChange(file, fileList) {
this.upload.fileName=file.name
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.sureName="上 传 中"
this.btnChangeEnable=true
this.$refs.upload.submit();
this.loading = false;
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.upload.open = true;
this.title = "添加【请填写功能名称】"; this.title = "添加";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -238,7 +321,7 @@ export default {
getFile(id).then(response => { getFile(id).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改【请填写功能名称】"; this.title = "修改";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -264,12 +347,13 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function () {
return delFile(ids); return delFile(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {

58
ruoyi-ui/src/views/system/manage/files.vue

@ -27,17 +27,7 @@
v-hasPermi="['system:videos:add']" v-hasPermi="['system:videos:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:videos:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
@ -49,25 +39,14 @@
v-hasPermi="['system:videos:remove']" v-hasPermi="['system:videos:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:videos:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="videosList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="videosList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" /> <el-table-column label="id" align="center" prop="id" />
<el-table-column label="目录名称" align="center" prop="name" /> <el-table-column label="文件名称" align="center" prop="name" />
<el-table-column label="文件类型:1:目录,2:文件,3:链接" align="center" prop="type" />
<el-table-column label="创建时间" align="center" prop="gmtCreate" width="180"> <el-table-column label="创建时间" align="center" prop="gmtCreate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span>
@ -82,13 +61,6 @@
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:videos:edit']" v-hasPermi="['system:videos:edit']"
>修改</el-button> >修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleFiles(scope.row)"
v-hasPermi="['system:videos:manageFiles']"
>管理文件</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -111,8 +83,8 @@
<!-- 添加或修改视频信息对话框 --> <!-- 添加或修改视频信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="目录名称" prop="name"> <el-form-item label="文件名称" prop="name">
<el-input v-model="form.name" placeholder="请输入目录名称" /> <el-input v-model="form.name" placeholder="请输入文件名称" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -120,16 +92,22 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<select-file ref="select" :video-id="parentId" @ok="handleQuery" > </select-file>
</div> </div>
</template> </template>
<script> <script>
import { listVideos, getVideos, delVideos, addVideos, updateVideos } from "@/api/system/videos"; import { listVideos, getVideos, delVideos, addVideos, updateVideos,addShareFile } from "@/api/system/videos";
import selectFile from "./selectFiles";
export default { export default {
name: "ManageFile", name: "ManageFile",
components:{
selectFile
},
data() { data() {
return { return {
parentId:-1,
// //
loading: true, loading: true,
// //
@ -168,8 +146,11 @@ export default {
}; };
}, },
created() { created() {
const videoId = this.$route.params && this.$route.params.videoId;
this.parentId=videoId
this.queryParams.parentId=videoId
this.getList(); this.getList();
console.log(this.$route.params)
}, },
methods: { methods: {
/** 查询视频信息列表 */ /** 查询视频信息列表 */
@ -195,7 +176,7 @@ export default {
type: null, type: null,
gmtModified: null, gmtModified: null,
gmtCreate: null, gmtCreate: null,
parentId: null, parentId: this.parentId,
fileId: null fileId: null
}; };
this.resetForm("form"); this.resetForm("form");
@ -218,10 +199,7 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.$refs.select.show();
this.open = true;
this.title = "添加视频信息";
this.form.type=1
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

368
ruoyi-ui/src/views/system/manage/selectFiles.vue

@ -1,15 +1,8 @@
<template> <template>
<div class="app-container"> <!-- 授权用户 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-dialog title="选择文件" :visible.sync="visible" width="800px" top="5vh" append-to-body>
<el-form-item label="文件id" prop="uuid"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-input <el-form-item label="备注名称" prop="videoName">
v-model="queryParams.uuid"
placeholder="请输入文件id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备注" prop="memo">
<el-input <el-input
v-model="queryParams.memo" v-model="queryParams.memo"
placeholder="请输入备注" placeholder="请输入备注"
@ -17,227 +10,93 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row>
<el-col :span="1.5"> <el-table @row-click="clickRow" ref="table" :data="shareList" @selection-change="handleSelectionChange" height="260px">
<el-button <el-table-column type="selection" width="55"></el-table-column>
type="primary" <el-table-column label="id" align="center" prop="id"/>
plain <el-table-column label="文件id" align="center" prop="uuid"/>
icon="el-icon-plus" <el-table-column label="视频名称" align="center" prop="videoName"/>
size="mini" <el-table-column label="备注" align="center" prop="memo"/>
@click="handleAdd" <el-table-column label="创建时间" align="center" prop="createTime" width="180">
v-hasPermi="['system:file:add']" <template slot-scope="scope">
>新增 <span>{{ parseTime(scope.row.createTime) }}</span>
</el-button> </template>
</el-col> </el-table-column>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:file:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:file:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="fileList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="文件id" align="center" prop="uuid"/>
<el-table-column label="视频名称" align="center" prop="videoName"/>
<el-table-column label="备注" align="center" prop="memo"/>
<el-table-column label="创建时间" align="center" prop="gmtCreate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:file:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:file:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改请填写功能名称对话框 -->
<!-- <el-dialog :title="title" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="备注" prop="memo">
<el-input v-model="form.memo" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>-->
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".mp4"
:headers="upload.headers"
:action="upload.url + '?remark=' + upload.updateSupport+'&videoName=' + upload.fileName"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
视频名称<el-input v-model="upload.fileName" />
</div>
<div class="el-upload__tip" slot="tip">
备注<el-input v-model="upload.updateSupport" />
</div>
<!-- <span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>-->
</div>
</el-upload>
</el-table>
<div slot="footer" class="dialog-footer"> </el-row>
<el-button type="primary" @click="submitFileForm"> </el-button> <div slot="footer" class="dialog-footer">
<el-button @click="upload.open = false"> </el-button> <el-button type="primary" @click="handleSelectUser"> </el-button>
</div> <el-button @click="visible = false"> </el-button>
</el-dialog> </div>
</div> </el-dialog>
</template> </template>
<script> <script>
import {listFile, getFile, delFile, addFile, updateFile} from "@/api/system/file"; import {listFile, getFile, delFile, addFile, updateFile,getNoAuthFiles} from "@/api/system/file";
import { listVideos, getVideos, delVideos, addVideos, updateVideos,addShareFile } from "@/api/system/videos";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
inheritAttrs: false, dicts: ['sys_normal_disable'],
name: "File", props: {
//
videoId: {
type: [Number, String]
}
},
data() { data() {
return { return {
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: '',
fileName: '',
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/videos/file/addFile"
},
// //
loading: true, visible: false,
// //
ids: [], shareIds: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
// //
total: 0, total: 0,
// //
fileList: [], shareList: [],
//
title: "",
//
open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
uuid: null, videoId: null,
memo: null, memo: '',
gmtCreate: null videoName: undefined,
},
//
form: {},
//
rules: {
} }
}; };
}, },created() {
created() {
this.getList(); const videoId = this.$route.params && this.$route.params.videoId;
console.log("selectFile",videoId)
}, },
methods: { methods: {
/** 查询【请填写功能名称】列表 */ //
getList() { show() {
this.loading = true; this.queryParams.videoId = this.videoId;
listFile(this.queryParams).then(response => { this.getList();
this.fileList = response.rows; this.visible = true;
this.total = response.total;
this.loading = false;
});
}, },
onOpen(){ clickRow(row) {
return false this.$refs.table.toggleRowSelection(row);
}, },
// //
cancel() { handleSelectionChange(selection) {
this.open = false; this.shareIds = selection.map(item => item.id);
this.reset();
}, },
// //
reset() { getList() {
this.formData = { this.shareList=[]
field101: null, getNoAuthFiles(this.queryParams).then(res => {
field102: undefined,
} this.shareList = res.data;
this.resetForm("form"); console.log(res.data)
this.resetForm("elForm"); });
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -249,94 +108,21 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
// /** 选择授权用户操作 */
handleSelectionChange(selection) { handleSelectUser() {
this.ids = selection.map(item => item.id) const videoId = this.queryParams.videoId;
this.single = selection.length !== 1 const shareIds = this.shareIds.join(",");
this.multiple = !selection.length if (shareIds == "") {
}, this.$modal.msgError("请选择要分配的用户");
onClose() { return;
}
}, addShareFile({videoId: videoId,ids:this.shareIds}).then(res => {
close() { this.$modal.msgSuccess(res.msg);
this.$emit('update:visible', false) if (res.code === 200) {
}, this.visible = false;
handleConfirm() { this.$emit("ok");
console.log(this.fileList.length)
console.log(this.formData.field102)
this.$refs['elForm'].validate(valid => {
if (!valid) return
this.close()
})
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.upload.open = true;
this.title = "添加";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getFile(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateFile(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addFile(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} }
}); });
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function () {
return delFile(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/file/export', {
...this.queryParams
}, `file_${new Date().getTime()}.xlsx`)
} }
} }
}; };

1228
ruoyi-ui/src/views/system/role/index.vue

File diff suppressed because it is too large Load Diff

123
ruoyi-ui/src/views/system/videos/index.vue

@ -1,54 +1,15 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="${comment}" prop="name"> <el-form-item label="目录名称" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
placeholder="请输入${comment}" placeholder="目录名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="${comment}" prop="path">
<el-input
v-model="queryParams.path"
placeholder="请输入${comment}"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="${comment}" prop="gmtModified">
<el-date-picker clearable
v-model="queryParams.gmtModified"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="gmtCreate">
<el-date-picker clearable
v-model="queryParams.gmtCreate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="parentId">
<el-input
v-model="queryParams.parentId"
placeholder="请输入${comment}"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="文件id" prop="fileId">
<el-input
v-model="queryParams.fileId"
placeholder="请输入文件id"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -103,22 +64,16 @@
<el-table v-loading="loading" :data="videosList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="videosList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="${comment}" align="center" prop="id" /> <el-table-column label="id" align="center" prop="id" />
<el-table-column label="${comment}" align="center" prop="name" /> <el-table-column label="目录名称" align="center" prop="name" />
<el-table-column label="${comment}" align="center" prop="path" /> <el-table-column label="目录下的文件" align="center" prop="filenames" />
<el-table-column label="文件类型:1:目录,2:文件,3:链接" align="center" prop="type" /> <el-table-column label="文件类型:1:目录,2:文件,3:链接" align="center" prop="type" />
<el-table-column label="${comment}" align="center" prop="gmtModified" width="180">
<template slot-scope="scope"> <el-table-column label="创建时间" align="center" prop="gmtCreate" width="180">
<span>{{ parseTime(scope.row.gmtModified, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="${comment}" align="center" prop="gmtCreate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="${comment}" align="center" prop="parentId" />
<el-table-column label="文件id" align="center" prop="fileId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -128,6 +83,22 @@
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:videos:edit']" v-hasPermi="['system:videos:edit']"
>修改</el-button> >修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleFiles(scope.row)"
v-hasPermi="['system:videos:manageFiles']"
>管理文件</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleShares(scope.row)"
v-hasPermi="['system:videos:manageFiles']"
>分享链接</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -138,7 +109,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -150,33 +121,8 @@
<!-- 添加或修改视频信息对话框 --> <!-- 添加或修改视频信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="${comment}" prop="name"> <el-form-item label="目录名称" prop="name">
<el-input v-model="form.name" placeholder="请输入${comment}" /> <el-input v-model="form.name" placeholder="请输入目录名称" />
</el-form-item>
<el-form-item label="${comment}" prop="path">
<el-input v-model="form.path" placeholder="请输入${comment}" />
</el-form-item>
<el-form-item label="${comment}" prop="gmtModified">
<el-date-picker clearable
v-model="form.gmtModified"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="gmtCreate">
<el-date-picker clearable
v-model="form.gmtCreate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
<el-form-item label="${comment}" prop="parentId">
<el-input v-model="form.parentId" placeholder="请输入${comment}" />
</el-form-item>
<el-form-item label="文件id" prop="fileId">
<el-input v-model="form.fileId" placeholder="请输入文件id" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -221,7 +167,7 @@ export default {
type: null, type: null,
gmtModified: null, gmtModified: null,
gmtCreate: null, gmtCreate: null,
parentId: null, parentId: 0,
fileId: null fileId: null
}, },
// //
@ -258,7 +204,7 @@ export default {
type: null, type: null,
gmtModified: null, gmtModified: null,
gmtCreate: null, gmtCreate: null,
parentId: null, parentId: 0,
fileId: null fileId: null
}; };
this.resetForm("form"); this.resetForm("form");
@ -284,6 +230,7 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加视频信息"; this.title = "添加视频信息";
this.form.type=1
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -325,6 +272,16 @@ export default {
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
}, },
/** 管理文件 */
handleFiles(row) {
this.$tab.openPage("管理"+row.id+"的文件", "/system/manage/user/"+row.id);
},
/** 管理文件 */
handleShares(row) {
this.$tab.openPage("管理分享"+row.id+"的链接", "/system/allow/user/"+row.id);
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('system/videos/export', { this.download('system/videos/export', {

Loading…
Cancel
Save