目录

人人开源使用笔记

目录

人人开源使用笔记

node版本:10.16.3

1.人人开源地址:

https://i-blog.csdnimg.cn/blog_migrate/c82f886373d868333af1641ac90d47b1.png

下载 fast-vue 、fast和generator,vue关闭eslint:搜索useEslint,设置为false

https://i-blog.csdnimg.cn/blog_migrate/5702ebf6322ccd9bb566c684403abc9e.png

fast-vue的版本问题:

先安装python2.7

npm install node-sass@5

npm i

npm run dev

node高版本无需安装python

如果npm不够高先执行(报错:npm npm does not support Node.js v20.11.0)

npm install -g npm
     
npm install --ignore-scripts
npm remove node-sass sass-loader
npm install --save sass-loader@7 sass babel-runtime qs vue-hot-reload-api svg-baker-runtime

2.fast后台服务使用

2.1mysql创建自己的数据库运行fast文件中的db文件夹下的mysql文件

https://i-blog.csdnimg.cn/blog_migrate/2d3f2ebc8851809e57ee973762787bb4.png

https://i-blog.csdnimg.cn/blog_migrate/e485d1f8c44f6f2e3ff15db795d27c16.png

运行mysql.sql,生成数据库表

https://i-blog.csdnimg.cn/blog_migrate/81c4011fa5cf9fab012fc4fdab3c7107.png

2.2 删除module下job文件夹下文件 只保留如下

https://i-blog.csdnimg.cn/blog_migrate/0c4384807ca581a4536743288fb80d41.png

2.3 重命名Application

https://i-blog.csdnimg.cn/blog_migrate/10ec1546304f798afc7c9bf14c2d0f82.png https://i-blog.csdnimg.cn/blog_migrate/9d9b1795b7a3f2a0d268036507222a41.png

2.4 修改数据库表sys_menu

https://i-blog.csdnimg.cn/blog_migrate/3bd03a56f8bf089f67b5ebfeaf56956f.png

2.5 pom. 使用如下

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>io.dtcg</groupId>
	<artifactId>dtcg-java</artifactId>
	<version>3.0.0</version>
	<packaging>jar</packaging>
	<description>dtcg-java</description>
 
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.5.6</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
 
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
		<mybatisplus.version>3.4.3.4</mybatisplus.version>
		<mysql.version>8.0.17</mysql.version>
		<mssql.version>4.0</mssql.version>
		<oracle.version>11.2.0.3</oracle.version>
		<druid.version>1.1.13</druid.version>
		<quartz.version>2.3.0</quartz.version>
		<commons.lang.version>2.6</commons.lang.version>
		<commons.fileupload.version>1.2.2</commons.fileupload.version>
		<commons.io.version>2.5</commons.io.version>
		<commons.codec.version>1.10</commons.codec.version>
		<commons.configuration.version>1.10</commons.configuration.version>
		<shiro.version>1.4.0</shiro.version>
		<jwt.version>0.7.0</jwt.version>
		<kaptcha.version>0.0.9</kaptcha.version>
		<qiniu.version>7.2.23</qiniu.version>
		<aliyun.oss.version>2.8.3</aliyun.oss.version>
		<qcloud.cos.version>4.4</qcloud.cos.version>
		<swagger.version>2.7.0</swagger.version>
		<joda.time.version>2.9.9</joda.time.version>
		<gson.version>2.8.5</gson.version>
		<fastjson.version>2.0.48</fastjson.version>
		<hutool.version>5.8.15</hutool.version>
		<lombok.version>1.18.22</lombok.version>
 
		<!--wagon plugin 配置-->
		<service-path>/work/renren</service-path>
		<pack-name>${project.artifactId}-${project.version}.jar</pack-name>
		<remote-addr>192.168.1.10:22</remote-addr>
		<remote-username>root</remote-username>
		<remote-passwd>123456</remote-passwd>
	</properties>
 
	<dependencies>
		<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-jdbc</artifactId>
			<version>2.6.1</version>
		</dependency>
 
		<!--腾讯云存储-->
		<!-- https://mvnrepository.com/artifact/com.qcloud/cos_api -->
		<dependency>
			<groupId>com.qcloud</groupId>
			<artifactId>cos_api</artifactId>
			<version>5.6.54</version>
		</dependency>
		<dependency>
			<groupId>com.qcloud</groupId>
			<artifactId>cos-sts_api</artifactId>
			<version>3.1.0</version>
		</dependency>
		<!--        Redis -->
		<!--         https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-redis</artifactId>
			<version>2.6.1</version>
			<exclusions>
				<exclusion>
					<!--  ettuce的bug导致netty堆外内存溢出-->
					<groupId>io.lettuce</groupId>
					<artifactId>lettuce-core</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
		<dependency>
			<groupId>redis.clients</groupId>
			<artifactId>jedis</artifactId>
			<version>3.7.1</version>
		</dependency>
 
 
		<!--        SpringCache-->
		<!--         https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-cache -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-cache</artifactId>
			<version>2.6.1</version>
		</dependency>
 
		<!--简化实体类,用@Data代替getset方法-->
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<version>1.18.8</version>
		</dependency>
		<!-- httpcomponent包。发送http请求 -->
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
			<version>4.4.13</version>
		</dependency>
		<!-- 数据库驱动 https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>8.0.17</version>
		</dependency>
		<!--tomcat里一般都带-->
		<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>4.0.1</version>
			<scope>provided</scope>
		</dependency>
 
		<!--JSR303校验包含了hibernate-validator-->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-validation</artifactId>
			<version>2.5.6</version>
		</dependency>
 
		<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<version>2.6.1</version>
			<scope>test</scope>
		</dependency>
 
		<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<version>2.6.1</version>
		</dependency>
 
		<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-aop -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-aop</artifactId>
			<version>2.6.1</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>5.3.14</version>
		</dependency>
 
		<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-configuration-processor -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-configuration-processor</artifactId>
			<version>2.6.1</version>
		</dependency>
 
		<!--<dependency>-->
		<!--<groupId>org.springframework.boot</groupId>-->
		<!--<artifactId>spring-boot-devtools</artifactId>-->
		<!--<optional>true</optional>-->
		<!--</dependency>-->
		<dependency>
			<groupId>com.baomidou</groupId>
			<artifactId>mybatis-plus-boot-starter</artifactId>
			<version>${mybatisplus.version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.baomidou</groupId>
					<artifactId>mybatis-plus-generator</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<!--oracle驱动-->
		<dependency>
			<groupId>com.oracle</groupId>
			<artifactId>ojdbc6</artifactId>
			<version>${oracle.version}</version>
		</dependency>
		<!--mssql驱动-->
		<dependency>
			<groupId>com.microsoft.sqlserver</groupId>
			<artifactId>sqljdbc4</artifactId>
			<version>${mssql.version}</version>
		</dependency>
		<!--postgresql驱动-->
		<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>42.3.1</version>
		</dependency>
 
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>druid-spring-boot-starter</artifactId>
			<version>1.2.8</version>
		</dependency>
		<dependency>
			<groupId>org.quartz-scheduler</groupId>
			<artifactId>quartz</artifactId>
			<version>2.3.2</version>
			<exclusions>
				<exclusion>
					<groupId>com.mchange</groupId>
					<artifactId>c3p0</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.quartz-scheduler/quartz-jobs -->
		<dependency>
			<groupId>org.quartz-scheduler</groupId>
			<artifactId>quartz-jobs</artifactId>
			<version>2.3.2</version>
		</dependency>
 
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>${commons.lang.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>${commons.fileupload.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commons.io.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<version>${commons.codec.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-configuration</groupId>
			<artifactId>commons-configuration</artifactId>
			<version>${commons.configuration.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.shiro</groupId>
			<artifactId>shiro-core</artifactId>
			<version>${shiro.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.shiro</groupId>
			<artifactId>shiro-spring</artifactId>
			<version>${shiro.version}</version>
		</dependency>
		<dependency>
			<groupId>io.jsonwebtoken</groupId>
			<artifactId>jjwt</artifactId>
			<version>${jwt.version}</version>
		</dependency>
		<dependency>
			<groupId>com.github.axet</groupId>
			<artifactId>kaptcha</artifactId>
			<version>${kaptcha.version}</version>
		</dependency>
		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger2</artifactId>
			<version>${swagger.version}</version>
		</dependency>
		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger-ui</artifactId>
			<version>${swagger.version}</version>
		</dependency>
		<dependency>
			<groupId>com.qiniu</groupId>
			<artifactId>qiniu-java-sdk</artifactId>
			<version>${qiniu.version}</version>
		</dependency>
		<dependency>
			<groupId>com.aliyun.oss</groupId>
			<artifactId>aliyun-sdk-oss</artifactId>
			<version>${aliyun.oss.version}</version>
		</dependency>
		<dependency>
			<groupId>com.qcloud</groupId>
			<artifactId>cos_api</artifactId>
			<version>${qcloud.cos.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
			<version>${joda.time.version}</version>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>${gson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>${fastjson.version}</version>
		</dependency>
		<dependency>
			<groupId>cn.hutool</groupId>
			<artifactId>hutool-all</artifactId>
			<version>${hutool.version}</version>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<version>${lombok.version}</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-maven-plugin -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<version>2.6.1</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
		<dependency>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.8.1</version>
		</dependency>
 
	</dependencies>
 
	<build>
		<finalName>${project.artifactId}</finalName>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ssh</artifactId>
				<version>2.8</version>
			</extension>
		</extensions>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>2.6.1</version>
				<configuration>
					<fork>true</fork>
				</configuration>
			</plugin>
			<!-- 跳过单元测试 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<skipTests>true</skipTests>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>wagon-maven-plugin</artifactId>
				<version>1.0</version>
				<configuration>
					<fromFile>target/${pack-name}</fromFile>
					<url><![CDATA[scp://${remote-username}:${remote-passwd}@${remote-addr}${service-path}]]></url>
					<commands>
						<!-- Kill Old Process -->
						<command>kill -9 `ps -ef |grep ${project.artifactId}.jar|grep -v "grep" |awk '{print $2}'`</command>
						<!-- Restart jar package,write result into renren.log -->
						<command><![CDATA[nohup java -jar ${service-path}/${pack-name} --spring.profiles.active=test > ${service-path}/renren.log 2>&1 & ]]></command>
						<command><![CDATA[netstat -nptl]]></command>
						<command><![CDATA[ps -ef | grep java | grep -v grep]]></command>
					</commands>
					<!-- 运行命令 mvn clean package wagon:upload-single wagon:sshexec-->
					<displayCommandOutputs>true</displayCommandOutputs>
				</configuration>
			</plugin>
 
			<plugin>
				<groupId>com.spotify</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<version>0.4.14</version>
				<!--<executions>-->
				<!--<execution>-->
				<!--<phase>package</phase>-->
				<!--<goals>-->
				<!--<goal>build</goal>-->
				<!--</goals>-->
				<!--</execution>-->
				<!--</executions>-->
				<configuration>
					<imageName>renren/fast</imageName>
					<dockerDirectory>${project.basedir}</dockerDirectory>
					<resources>
						<resource>
							<targetPath>/</targetPath>
							<directory>${project.build.directory}</directory>
							<include>${project.build.finalName}.jar</include>
						</resource>
					</resources>
				</configuration>
				<!-- 运行命令 mvn clean package docker:build 打包并生成docker镜像 -->
			</plugin>
		</plugins>
	</build>
 
	<repositories>
		<repository>
			<id>public</id>
			<name>aliyun nexus</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>public</id>
			<name>aliyun nexus</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>
 
</project>

2.6 修改properties (注意修改数据库名)

2.6.1 application.properties

spring.application.name=ying-die
server.port=88
spring.profiles.active=dev
server.shutdown=graceful

spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8

mybatis-plus.mapper-locations=classpath*:/mapper/**/*.xml
mybatis-plus.type-aliases-package=io.renren.modules._._
mybatis-plus.global-config.db-config.id-type=auto
mybatis-plus.global-config.db-config.logic-delete-value=-1
mybatis-plus.global-config.db-config.logic-not-delete-value=0
mybatis-plus.configuration.map-underscore-to-camel-case=true
mybatis-plus.configuration.cache-enabled=false
mybatis-plus.configuration.call-setters-on-nulls=true
mybatis-plus.configuration.jdbc-type-for-null='null'
#mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.nologging.NoLoggingImpl

renren.jwt.expire=604800
renren.jwt.header=token
renren.jwt.secret=f4e2e52034348f86b67cde581c0f9eb5[www.renren.io]

renren.redis.open=false
renren.shiro.redis=false

2.6.2 application-dev.properties

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://10.0.1.2:3306/Whir_fast_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.username=Whir_fast_admin
spring.datasource.password=YCaCLuQZ8vJkL6

spring.redis.host=10.0.1.3
spring.cache.type=redis

2.6.3 application-prod.properties(druid)

spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.druid.url=jdbc:mysql://192.168.56.11:3306/Whir_fast_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.druid.username=root
spring.datasource.druid.password=root

spring.redis.host=192.168.56.11
spring.cache.type=redis

2.7 修改 MybatisPlusConfig  分页配置

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**

- mybatis-plus 配置
-
- @author Mark sunlightcs@gmail.com
  */
  @Configuration
  public class MybatisPlusConfig {

      /**
       * 分页插件
       *
       * @return
       */
      // 最新版
      @Bean
      public MybatisPlusInterceptor mybatisPlusInterceptor() {
          MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
          interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
          return interceptor;
      }

}

2.8 添加 MyCacheConfig.java 文件

import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext;

@Configuration
@EnableCaching
public class MyCacheConfig {
@Bean
public RedisCacheConfiguration redisCacheConfiguration(CacheProperties cacheProperties) {

        CacheProperties.Redis redisProperties = cacheProperties.getRedis();
        RedisCacheConfiguration config = RedisCacheConfiguration
                .defaultCacheConfig();
        //指定缓存序列化方式为json
        config = config.serializeValuesWith(
                RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()));
        //设置配置文件中的各项配置,如过期时间
        if (redisProperties.getTimeToLive() != null) {
            config = config.entryTtl(redisProperties.getTimeToLive());
        }

        if (redisProperties.getKeyPrefix() != null) {
            config = config.prefixKeysWith(redisProperties.getKeyPrefix());
        }
        if (!redisProperties.isCacheNullValues()) {
            config = config.disableCachingNullValues();
        }
        if (!redisProperties.isUseKeyPrefix()) {
            config = config.disableKeyPrefix();
        }
        return config;
    }

}

2.9 删除 mapper 下的 job 文件的 xml

https://i-blog.csdnimg.cn/blog_migrate/b28402f5b3eb79388b305b58ea97a44f.png

2.10 修改 CorsConfig 跨域

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

@Configuration // gateway
public class CorsConfig {
@Bean
public CorsFilter corsFilter()
{
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
// 设置访问源地址
config.addAllowedOriginPattern("_");
// 设置访问源请求头
config.addAllowedHeader("_");
// 设置访问源请求方法
config.addAllowedMethod("_");
// 对接口配置跨域设置
source.registerCorsConfiguration("/**", config);
return new CorsFilter(source);
}
}

2.11 启动 admin.vue 修改 static 文件件下 index.js 文件地址为自己 server 启动的地址进行测试

如果 npm install 无法安装 node-sass 执行

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

https://i-blog.csdnimg.cn/blog_migrate/20ea1a355b4c30670ad18cb81759bf5a.png

2.12 vue 后台角色添加管理员,权限赋予管理员列表的 admin

https://i-blog.csdnimg.cn/blog_migrate/f82e2d1a317f0288f2ebefa6e8870a98.png

https://i-blog.csdnimg.cn/blog_migrate/16a75f846a8b52e0578e0feb6703ecae.png

2.13 修改 modules/sys/controller/SysLoginController.java 取消验证码验证

https://i-blog.csdnimg.cn/blog_migrate/1bddd767b0e980be1e14fe7f7dc7b7de.png

2.14 修改 SysMenuController (改为 26)

https://i-blog.csdnimg.cn/blog_migrate/58a42252d4f62569c5a607191ac808eb.png

2.15 PageUtils 添加空构造

https://i-blog.csdnimg.cn/blog_migrate/4d66f58ea7b6b30f8f911ffa40493f68.png

 /**
_ 分页 *
_ @param flag true,自动分页
_/
public PageUtils(List<?> list, int totalCount, Map<String, Object> params, boolean flag) {
long sizeLong = 10;
long currentLong = 0;
String limit = (String) params.get(Constant.LIMIT);
String pageSize = (String) params.get(Constant.PAGE);
if (StringUtils.isNotEmpty(limit)) {
sizeLong = Long.parseLong(limit);
}
if (StringUtils.isNotEmpty(pageSize)) {
long l = Long.parseLong(pageSize);
currentLong = (int) l > 0 ? (int) l - 1 : 0;

        }
        if (flag) {
            list = list.stream().skip(sizeLong * currentLong).limit(sizeLong).collect(Collectors.toList());
        }
        this.list = list;
        this.totalCount = totalCount;
        this.pageSize = (int) sizeLong;
        this.currPage = (int) currentLong;
        this.totalPage = (int) Math.ceil((double) totalCount / sizeLong);
    }

2.16 后台nav侧边栏排SysMenuServiceImpl.java

.orderByDesc("order_num")

https://i-blog.csdnimg.cn/blog_migrate/496ede0ea0e1c4ec64e33946c317bbcb.png

2.17  菜单列表排序  SysMenuController 和SysMenuServiceImpl

https://i-blog.csdnimg.cn/blog_migrate/16fb0d2f878177673935d6c90e47590c.png https://i-blog.csdnimg.cn/blog_migrate/d9e5c206fb72e7f39e14361567261c26.png

return list(new QueryWrapper<SysMenuEntity>().orderByAsc("order_num"));
2.18,RRExceptionHandler添加
    @ExceptionHandler(value = MethodArgumentNotValidException.class)
    public R handleValidException(MethodArgumentNotValidException e) {
        logger.error("数据校验出现问题{}", e.getMessage());
        BindingResult bindingResult = e.getBindingResult();
        Map<String, String> errMap = new HashMap<>();
        bindingResult.getFieldErrors().forEach(fieldError -> {
            errMap.put(fieldError.getField(), fieldError.getDefaultMessage());
        });
        return R.error().put("data", errMap);
    }
    @ExceptionHandler(value = BindException.class)
    public R handleBindException(MethodArgumentNotValidException e) {
        logger.error("数据校验出现问题{}", e.getMessage());
        BindingResult bindingResult = e.getBindingResult();
        Map<String, String> errMap = new HashMap<>();
        bindingResult.getFieldErrors().forEach(fieldError -> {
            errMap.put(fieldError.getField(), fieldError.getDefaultMessage());
        });
        return R.error().put("data", errMap);
    }

3.修改只有admin是管理员的问题

3.1 修改sys/controller/SysUserController.java文件

https://i-blog.csdnimg.cn/blog_migrate/bfcd97ba4450d2d131076605fd57740b.png

3.2修改service/impl/SysRoleServiceImpl.java

https://i-blog.csdnimg.cn/blog_migrate/1e81ae24063b8d30bf92334383ab37e8.png

https://i-blog.csdnimg.cn/blog_migrate/10ffe0422aee9c5ede44e5c5c82ae6c1.png

3.3 修改/impl/SysUserServiceImpl.java

https://i-blog.csdnimg.cn/blog_migrate/e9fc91e3402d445d8edf880e7aeb57a7.png

https://i-blog.csdnimg.cn/blog_migrate/dddee3901e2ee32385940dc85a0689ba.png

3.4 修改sys/service/impl/ShiroServiceImpl.java

https://i-blog.csdnimg.cn/blog_migrate/bb7fa5f19a02e4fc9eaec769691903c6.png

3.5 修改/service/impl/SysMenuServiceImpl.java

https://i-blog.csdnimg.cn/blog_migrate/2b7c93567d418987c1d4050b0da30b42.png

3.6 修改 SysRoleController

https://i-blog.csdnimg.cn/blog_migrate/978f40b1f097e0175b048422baf878ff.png

4.避免用户密码为空,修改SysUserServiceImpl

		String password = user.getPassword();
    	if (password==null|| StringUtils.isEmpty(password)) {
    		password = "admin";
    	}
    	user.setPassword(new Sha256Hash(password, salt).toHex());

https://i-blog.csdnimg.cn/blog_migrate/4d11bc1cb8c1421f74d9b84d1d731386.png

5.去除多数据源配置

DynamicDataSourceConfig

https://i-blog.csdnimg.cn/blog_migrate/d18ee27fe57bd8f6112b0f3974fd0c28.png

6.redis启用查看:RedisAspect.java

清空QRTZ表

SET FOREIGN_KEY_CHECKS=0;

TRUNCATE TABLE QRTZ_BLOB_TRIGGERS

TRUNCATE TABLE QRTZ_CALENDARS

TRUNCATE TABLE QRTZ_CRON_TRIGGERS

TRUNCATE TABLE QRTZ_FIRED_TRIGGERS

TRUNCATE TABLE QRTZ_JOB_DETAILS

TRUNCATE TABLE QRTZ_LOCKS

TRUNCATE TABLE QRTZ_PAUSED_TRIGGER_GRPS

TRUNCATE TABLE QRTZ_SCHEDULER_STATE

TRUNCATE TABLE QRTZ_SIMPLE_TRIGGERS

TRUNCATE TABLE QRTZ_SIMPROP_TRIGGERS

TRUNCATE TABLE QRTZ_TRIGGERS

SET FOREIGN_KEY_CHECKS=1;

vue返回上一页

  computed: {
    mainTabs: {
      get() {
        return this.$store.state.common.mainTabs
      },
      set(val) {
        this.$store.commit('common/updateMainTabs', val)
      },
    },
    mainTabsActiveName: {
      get() {
        return this.$store.state.common.mainTabsActiveName
      },
      set(val) {
        this.$store.commit('common/updateMainTabsActiveName', val)
      },
    },

},

method 里:

 // tabs, 关闭当前
cancel() {
this.mainTabs = this.mainTabs.filter(
(item) => item.name !== this.mainTabsActiveName
)
// 返回上一步路由
this.$router.go(-1)
},
el-tree 可以滑动

添加

style="max-height: 400px; overflow-y: auto;"