parent
addbb1f33b
commit
9b53881b40
71 changed files with 344 additions and 103 deletions
@ -1,35 +0,0 @@ |
||||
target/ |
||||
logs/ |
||||
.mvn/ |
||||
mvnw |
||||
mvnw.cmd |
||||
!**/src/main/** |
||||
!**/src/test/** |
||||
|
||||
src/main/resources/docs/ |
||||
|
||||
### STS ### |
||||
.apt_generated |
||||
.classpath |
||||
.factorypath |
||||
.project |
||||
.settings |
||||
.springBeans |
||||
.sts4-cache |
||||
|
||||
### IntelliJ IDEA ### |
||||
.idea |
||||
*.iws |
||||
*.iml |
||||
*.ipr |
||||
|
||||
### NetBeans ### |
||||
/nbproject/private/ |
||||
/nbbuild/ |
||||
/dist/ |
||||
/nbdist/ |
||||
/.nb-gradle/ |
||||
build/ |
||||
|
||||
### VS Code ### |
||||
.vscode/ |
@ -0,0 +1,19 @@ |
||||
|
||||
#·þÎñÃû³Æ |
||||
spring.application.name=dq-financial-crms |
||||
#ÅäÖÃÖÐÐĵØÖ· |
||||
spring.cloud.nacos.config.server-addr=192.168.31.142:8848 |
||||
spring.cloud.nacos.config.namespace=37d72d30-3178-4173-8b5e-269a23355ed9 |
||||
#spring.cloud.nacos.config.group=prod |
||||
|
||||
spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml |
||||
spring.cloud.nacos.config.ext-config[0].group=dev |
||||
spring.cloud.nacos.config.ext-config[0].refresh=true |
||||
|
||||
spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml |
||||
spring.cloud.nacos.config.ext-config[1].group=dev |
||||
spring.cloud.nacos.config.ext-config[1].refresh=true |
||||
|
||||
spring.cloud.nacos.config.ext-config[2].data-id=other.yml |
||||
spring.cloud.nacos.config.ext-config[2].group=dev |
||||
spring.cloud.nacos.config.ext-config[2].refresh=true |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,47 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<configuration> |
||||
<!--定义日志文件的存储地址,使用绝对路径--> |
||||
<property name="LOG_HOME" value="d:/logs/daqing/crms_auth"/> |
||||
|
||||
<!-- Console 输出设置 --> |
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
||||
<encoder> |
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> |
||||
<charset>utf8</charset> |
||||
</encoder> |
||||
</appender> |
||||
|
||||
<!-- 按照每天生成日志文件 --> |
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
<!--日志文件输出的文件名--> |
||||
<fileNamePattern>${LOG_HOME}/crms_auth.%d{yyyy-MM-dd}.log</fileNamePattern> |
||||
</rollingPolicy> |
||||
<encoder> |
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> |
||||
</encoder> |
||||
</appender> |
||||
|
||||
<!-- 异步输出 --> |
||||
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender"> |
||||
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> |
||||
<discardingThreshold>0</discardingThreshold> |
||||
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> |
||||
<queueSize>512</queueSize> |
||||
<!-- 添加附加的appender,最多只能添加一个 --> |
||||
<appender-ref ref="FILE"/> |
||||
</appender> |
||||
|
||||
|
||||
<logger name="org.apache.ibatis.cache.decorators.LoggingCache" level="DEBUG" additivity="false"> |
||||
<appender-ref ref="CONSOLE"/> |
||||
</logger> |
||||
<logger name="org.springframework.boot" level="DEBUG"/> |
||||
<root level="info"> |
||||
<!--<appender-ref ref="ASYNC"/>--> |
||||
<appender-ref ref="FILE"/> |
||||
<appender-ref ref="CONSOLE"/> |
||||
</root> |
||||
</configuration> |
@ -0,0 +1,10 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
||||
<mapper namespace="com.daqing.financial.crauth.dao.CustomerLoginDao"> |
||||
|
||||
<select id="getCustomer" parameterType="string" resultType="com.daqing.framework.domain.crms.CustomerEntity"> |
||||
SELECT phone,password FROM crms_customer WHERE phone = #{phone} |
||||
</select> |
||||
|
||||
</mapper> |
Binary file not shown.
@ -0,0 +1,33 @@ |
||||
package com.daqing.financial.crms.config; |
||||
|
||||
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; |
||||
|
||||
/** |
||||
* 实现基本的跨域请求 |
||||
* |
||||
* @auther River |
||||
* @date 2020/9/25 15:09 |
||||
*/ |
||||
@Configuration |
||||
public class CorsConfig { |
||||
|
||||
@Bean |
||||
public CorsFilter corsFilter() { |
||||
final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource(); |
||||
final CorsConfiguration corsConfiguration = new CorsConfiguration(); |
||||
/*是否允许请求带有验证信息*/ |
||||
corsConfiguration.setAllowCredentials(true); |
||||
/*允许访问的客户端域名*/ |
||||
corsConfiguration.addAllowedOrigin("*"); |
||||
/*允许服务端访问的客户端请求头*/ |
||||
corsConfiguration.addAllowedHeader("*"); |
||||
/*允许访问的方法名,GET POST等*/ |
||||
corsConfiguration.addAllowedMethod("*"); |
||||
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration); |
||||
return new CorsFilter(urlBasedCorsConfigurationSource); |
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,33 @@ |
||||
package com.daqing.financial.hrms.config; |
||||
|
||||
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; |
||||
|
||||
/** |
||||
* 实现基本的跨域请求 |
||||
* |
||||
* @auther River |
||||
* @date 2020/9/25 15:09 |
||||
*/ |
||||
@Configuration |
||||
public class CorsConfig { |
||||
|
||||
@Bean |
||||
public CorsFilter corsFilter() { |
||||
final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource(); |
||||
final CorsConfiguration corsConfiguration = new CorsConfiguration(); |
||||
/*是否允许请求带有验证信息*/ |
||||
corsConfiguration.setAllowCredentials(true); |
||||
/*允许访问的客户端域名*/ |
||||
corsConfiguration.addAllowedOrigin("*"); |
||||
/*允许服务端访问的客户端请求头*/ |
||||
corsConfiguration.addAllowedHeader("*"); |
||||
/*允许访问的方法名,GET POST等*/ |
||||
corsConfiguration.addAllowedMethod("*"); |
||||
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration); |
||||
return new CorsFilter(urlBasedCorsConfigurationSource); |
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,32 @@ |
||||
package com.daqing.framework.model.response; |
||||
|
||||
/** |
||||
* 提示信息 |
||||
* |
||||
* @auther River |
||||
* @date 2020/9/27 11:56 |
||||
*/ |
||||
public class PromptSuccess { |
||||
|
||||
private static final String DELETE_SUCCESS = "删除成功!"; |
||||
|
||||
private static final String DELETE_FAIL = "删除失败!"; |
||||
|
||||
private static final String NO_BEING = "该员工已不存在"; |
||||
|
||||
public static String getDeleteSuccess(){ |
||||
|
||||
return PromptSuccess.DELETE_SUCCESS; |
||||
} |
||||
|
||||
public static String getDeleteFail(){ |
||||
|
||||
return PromptSuccess.DELETE_FAIL; |
||||
} |
||||
|
||||
public static String getNoBeing(){ |
||||
|
||||
return PromptSuccess.NO_BEING; |
||||
} |
||||
|
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,34 @@ |
||||
spring: |
||||
cloud: |
||||
gateway: |
||||
routes: |
||||
# - id: test_route |
||||
# uri: https://www.baidu.com |
||||
# predicates: |
||||
# - Query=url,baidu |
||||
# |
||||
# - id: qq_route |
||||
# uri: https://www.qq.com |
||||
# predicates: |
||||
# - Query=url,qq |
||||
# |
||||
- id: hrms_route |
||||
uri: lb://dq-financial-hrms |
||||
predicates: |
||||
- Path=/api/hrms/** |
||||
filters: |
||||
- RewritePath=/api/(?<segment>.*),/ $\{segment} |
||||
- |
||||
- id: crms_auth |
||||
uri: lb://dq-financial-crms |
||||
predicates: |
||||
- Path=/crms/** |
||||
filters: |
||||
- RewritePath=/crms/(?<segment>.*),/ $\{segment} |
||||
|
||||
redis: |
||||
host: |
||||
port: |
||||
password: |
||||
database: 1 |
||||
timeout: 60s |
@ -0,0 +1,9 @@ |
||||
#服务名称 |
||||
spring.application.name=dq-govern-gateway |
||||
#配置中心地址 |
||||
spring.cloud.nacos.config.server-addr=192.168.31.142:8848 |
||||
spring.cloud.nacos.config.namespace=772e2607-b929-4246-9671-ee5a36d74d25 |
||||
|
||||
spring.cloud.nacos.config.ext-config[0].data-id=dq-govern-gateway.yml |
||||
spring.cloud.nacos.config.ext-config[0].group=dev |
||||
spring.cloud.nacos.config.ext-config[0].refresh=true |
@ -0,0 +1 @@ |
||||
jwt.ignoreUrlList=/route-api/login,/route-api/refresh |
Loading…
Reference in new issue