Merge pull request #30 from menghaoranss/modify-path
Revise Bootstrap path
diff --git a/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/cloud/ui/config/advice/ConsoleRestControllerAdvice.java b/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/cloud/ui/config/advice/ConsoleRestControllerAdvice.java
deleted file mode 100644
index 8dda139..0000000
--- a/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/cloud/ui/config/advice/ConsoleRestControllerAdvice.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.ui.config.advice;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.elasticjob.infra.exception.ExceptionUtils;
-import org.springframework.core.MethodParameter;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.server.ServerHttpRequest;
-import org.springframework.http.server.ServerHttpResponse;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.RestControllerAdvice;
-import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
-
-/**
- * Console rest controller advice.
- **/
-@RestControllerAdvice
-@Slf4j
-public final class ConsoleRestControllerAdvice implements ResponseBodyAdvice<Object> {
-
- @Override
- public boolean supports(final MethodParameter returnType, final Class<? extends HttpMessageConverter<?>> converterType) {
- //only advice return void method.
- if (null == returnType.getMethod()) {
- return false;
- }
- return void.class.isAssignableFrom(returnType.getMethod().getReturnType());
- }
-
- @Override
- public Object beforeBodyWrite(final Object body, final MethodParameter returnType, final MediaType selectedContentType,
- final Class<? extends HttpMessageConverter<?>> selectedConverterType, final ServerHttpRequest request, final ServerHttpResponse response) {
- //if the method return void, then the value is true and returns.
- return null == body ? true : body;
- }
-
- /**
- * Handle exception.
- *
- * @param ex exception
- * @return response result
- */
- @ExceptionHandler(Exception.class)
- public ResponseEntity<String> toResponse(final Exception ex) {
- log.error("CONSOLE ERROR", ex);
- return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(ExceptionUtils.transform(ex));
- }
-}
diff --git a/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-frontend/src/router/index.js b/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-frontend/src/router/index.js
index fc6e200..646f3ff 100644
--- a/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-frontend/src/router/index.js
+++ b/shardingsphere-elasticjob-cloud-ui/shardingsphere-elasticjob-cloud-ui-frontend/src/router/index.js
@@ -22,6 +22,11 @@
export const constantRouterMap = [
{
+ path: '/',
+ component: () => import('@/views/login'),
+ hidden: true
+ },
+ {
path: '/login',
component: () => import('@/views/login'),
hidden: true
diff --git a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/lite/ui/config/advice/ConsoleRestControllerAdvice.java b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/lite/ui/config/advice/ConsoleRestControllerAdvice.java
deleted file mode 100644
index fd4584c..0000000
--- a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-backend/src/main/java/org/apache/shardingsphere/elasticjob/lite/ui/config/advice/ConsoleRestControllerAdvice.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.lite.ui.config.advice;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.elasticjob.infra.exception.ExceptionUtils;
-import org.springframework.core.MethodParameter;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.server.ServerHttpRequest;
-import org.springframework.http.server.ServerHttpResponse;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.RestControllerAdvice;
-import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
-
-/**
- * Console rest controller advice.
- **/
-@RestControllerAdvice
-@Slf4j
-public final class ConsoleRestControllerAdvice implements ResponseBodyAdvice<Object> {
-
- @Override
- public boolean supports(final MethodParameter returnType, final Class<? extends HttpMessageConverter<?>> converterType) {
- //only advice return void method.
- if (null == returnType.getMethod()) {
- return false;
- }
- return void.class.isAssignableFrom(returnType.getMethod().getReturnType());
- }
-
- @Override
- public Object beforeBodyWrite(final Object body, final MethodParameter returnType, final MediaType selectedContentType,
- final Class<? extends HttpMessageConverter<?>> selectedConverterType, final ServerHttpRequest request, final ServerHttpResponse response) {
- //if the method return void, then the value is true and returns.
- return null == body ? true : body;
- }
-
- /**
- * Handle exception.
- *
- * @param ex exception
- * @return response result
- */
- @ExceptionHandler(Exception.class)
- public ResponseEntity<String> toResponse(final Exception ex) {
- log.error("CONSOLE ERROR", ex);
- return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(ExceptionUtils.transform(ex));
- }
-}
diff --git a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/router/index.js b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/router/index.js
index 6e1258c..08cad6a 100644
--- a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/router/index.js
+++ b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/router/index.js
@@ -22,6 +22,11 @@
export const constantRouterMap = [
{
+ path: '/',
+ component: () => import('@/views/login'),
+ hidden: true
+ },
+ {
path: '/login',
component: () => import('@/views/login'),
hidden: true