mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
modify
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
package com.alibaba.otter.canal.admin.config;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.otter.canal.admin.controller.UserController;
|
||||
import com.alibaba.otter.canal.admin.model.BaseModel;
|
||||
import com.alibaba.otter.canal.admin.model.User;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -14,7 +12,10 @@ import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import com.alibaba.otter.canal.admin.controller.UserController;
|
||||
import com.alibaba.otter.canal.admin.model.BaseModel;
|
||||
import com.alibaba.otter.canal.admin.model.User;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
@@ -75,42 +76,4 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
}
|
||||
}).addPathPatterns("/api/**").excludePathPatterns("/api/**/user/**");
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨域支持
|
||||
*
|
||||
* @param registry
|
||||
*/
|
||||
// @Override
|
||||
// public void addCorsMappings(CorsRegistry registry) {
|
||||
// registry.addMapping("/api")
|
||||
// .allowedOrigins("http://127.0.0.1")
|
||||
// .allowCredentials(true)
|
||||
// .allowedMethods("*")
|
||||
// .allowedHeaders("Origin, X-Requested-With, Content-Type, Accept,
|
||||
// Authorization")
|
||||
// .maxAge(3600 * 24);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 添加静态资源--过滤swagger-api (开源的在线API文档)
|
||||
*
|
||||
* @param registry
|
||||
*/
|
||||
// @Override
|
||||
// public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
// // 过滤swagger
|
||||
// registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||
//
|
||||
// registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
//
|
||||
// registry.addResourceHandler("/swagger-resources/**")
|
||||
// .addResourceLocations("classpath:/META-INF/resources/swagger-resources/");
|
||||
//
|
||||
// registry.addResourceHandler("/swagger/**").addResourceLocations("classpath:/META-INF/resources/swagger*");
|
||||
//
|
||||
// registry.addResourceHandler("/v2/api-docs/**")
|
||||
// .addResourceLocations("classpath:/META-INF/resources/v2/api-docs/");
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ public class CanalConfigController {
|
||||
@Autowired
|
||||
CanalConfigService canalConfigService;
|
||||
|
||||
@RequestMapping(value = "/config", method = RequestMethod.GET)
|
||||
@GetMapping(value = "/config")
|
||||
public BaseModel<CanalConfig> canalConfig(@PathVariable String env) {
|
||||
return BaseModel.getInstance(canalConfigService.getCanalConfig());
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/config", method = RequestMethod.PUT)
|
||||
@PutMapping(value = "/config")
|
||||
public BaseModel<String> updateConfig(@RequestBody CanalConfig canalConfig, @PathVariable String env) {
|
||||
canalConfigService.updateContent(canalConfig);
|
||||
return BaseModel.getInstance("success");
|
||||
|
||||
@@ -24,8 +24,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: 'Vue Admin Template',
|
||||
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
|
||||
title: '',
|
||||
logo: './logo.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,8 +55,8 @@ export default {
|
||||
width: 100%;
|
||||
|
||||
& .sidebar-logo {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
width: 55px;
|
||||
// height: 32px;
|
||||
vertical-align: middle;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">Login</el-button>
|
||||
|
||||
<div class="tips">
|
||||
<span style="margin-right:20px;">username: admin</span>
|
||||
<span> password: any</span>
|
||||
<!-- <span style="margin-right:20px;">username: admin</span>
|
||||
<span> password: any</span> -->
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
@@ -74,8 +74,8 @@ export default {
|
||||
}
|
||||
return {
|
||||
loginForm: {
|
||||
username: 'admin',
|
||||
password: '111111'
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
loginRules: {
|
||||
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
|
||||
|
||||
Reference in New Issue
Block a user