Browse Source

修改配置

yingp 5 years ago
parent
commit
f17d196947

+ 1 - 1
README.md

@@ -31,7 +31,7 @@ gradlew build -x test
 # 发布
 gradlew publish -x test
 # 打包+发布release版本
-gradlew build publish -x test -PprojVersion='1.0.0'
+gradlew build publish -x test -PprojVersion=1.0.0
 ```
 
 ### jenkins构建

+ 2 - 0
uas-office-dingtalk-server/src/main/resources/application.yaml

@@ -5,6 +5,8 @@ server:
   servlet:
     context-path: /office
 spring:
+  profiles:
+    active: dev
   http:
     encoding:
       force: true

+ 4 - 0
uas-office-dingtalk-server/src/main/resources/config/application-prod.yaml

@@ -0,0 +1,4 @@
+spring:
+  redis:
+    host: 127.0.0.1
+    port: 6379

+ 4 - 0
uas-office-qywx-server/src/main/resources/config/application-prod.yaml

@@ -0,0 +1,4 @@
+spring:
+  redis:
+    host: 127.0.0.1
+    port: 6379

+ 0 - 37
uas-office-server/src/main/java/com/usoftchina/uas/office/config/WebMvcConfig.java

@@ -1,37 +0,0 @@
-package com.usoftchina.uas.office.config;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.HttpHeaders;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-/**
- * @author yingp
- * @date 2018/11/7
- */
-@Configuration
-public class WebMvcConfig implements WebMvcConfigurer {
-
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-        registry.addMapping("/**")
-                .allowedOrigins("*")
-                .allowedMethods("*")
-                .allowedHeaders("*")
-                .allowCredentials(true)
-                .exposedHeaders(HttpHeaders.SET_COOKIE).maxAge(3600L);
-    }
-
-    @Override
-    public void addViewControllers(ViewControllerRegistry registry) {
-        registry.addViewController("/index").setViewName("dc.html");
-        registry.addViewController("/").setViewName("dc.html");
-        registry.addViewController("/login").setViewName("/login.html");
-        registry.addViewController("/agent").setViewName("agent.html");
-        registry.addViewController("/addrbook").setViewName("addrbook.html");
-        registry.addViewController("/corp").setViewName("corp.html");
-    }
-}
-
-

+ 0 - 60
uas-office-server/src/main/java/com/usoftchina/uas/office/config/WebSecurityConfig.java

@@ -1,60 +0,0 @@
-package com.usoftchina.uas.office.config;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-import org.springframework.security.config.http.SessionCreationPolicy;
-import org.springframework.security.crypto.password.PasswordEncoder;
-
-/**
- * @author yingp
- * @date 2019/3/11
- */
-@Configuration
-@EnableWebSecurity
-public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
-    @Override
-    public void configure(WebSecurity web) throws Exception {
-        web.ignoring().antMatchers("/resources/**", "/static/**", "/public/**",
-                "/html/**", "/css/**", "/js/**", "**/*.css", "**/*.js", "/api/**");
-    }
-
-    @Override
-    protected void configure(HttpSecurity http) throws Exception {
-        http.authorizeRequests()
-                .antMatchers("/login")
-                .permitAll()
-                .anyRequest()
-                .authenticated()
-                .and()
-                .formLogin()
-                .loginPage("/login")
-                .and()
-                .csrf()
-                .disable()
-                .sessionManagement()
-                .sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED);
-    }
-
-    @Autowired
-    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
-        auth.inMemoryAuthentication().passwordEncoder(new PlainTextPasswordEncoder())
-                .withUser("admin").password("select111***").roles("ADMIN");
-    }
-
-    class PlainTextPasswordEncoder implements PasswordEncoder {
-        @Override
-        public String encode(CharSequence rawPassword) {
-            return rawPassword.toString();
-        }
-
-        @Override
-        public boolean matches(CharSequence rawPassword, String encodedPassword) {
-            return encodedPassword.equals(rawPassword.toString());
-        }
-    }
-}