diff --git a/admin-web/README-antd.md b/admin-web/README-antd.md deleted file mode 100644 index ce0725dfd..000000000 --- a/admin-web/README-antd.md +++ /dev/null @@ -1,136 +0,0 @@ -English | [简体中文](./README.zh-CN.md) | [Русский](./README.ru-RU.md) - -
](http://godban.github.io/browsers-support-badges/)IE / Edge | [
](http://godban.github.io/browsers-support-badges/)Firefox | [
](http://godban.github.io/browsers-support-badges/)Chrome | [
](http://godban.github.io/browsers-support-badges/)Safari | [
](http://godban.github.io/browsers-support-badges/)Opera |
-| --------- | --------- | --------- | --------- | --------- |
-| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
-
-## Contributing
-
-Any type of contribution is welcome, here are some examples of how you may contribute to this project:
-
-- Use Ant Design Pro in your daily work.
-- Submit [issues](http://github.com/ant-design/ant-design-pro/issues) to report bugs or ask questions.
-- Propose [pull requests](http://github.com/ant-design/ant-design-pro/pulls) to improve our code.
diff --git a/admin-web/README.md b/admin-web/README.md
index 43e8a3284..b40101c02 100644
--- a/admin-web/README.md
+++ b/admin-web/README.md
@@ -3,3 +3,32 @@
> 采用 antd pro 快速开发
> TODO
+
+## 命名规范
+
+#### 1.文件夹命名
+
+文件夹命名全部小写,单词之间以中划线隔离 例如: node-modules
+
+
+#### 2.文件命名
+
+文件以小写开头,以驼峰格式连接单词 例如: dashBoard.js
+component目录下的文件 以大写开头
+route目录下的文件以大写开头
+model目录下的文件大写开头
+
+
+#### 3.标点符号
+
+对于字符串统一用单引号 例如: 'hello world'
+
+#### 4.语法规范
+
+JS语法规范遵守ES6规范
+http://www.tuicool.com/articles/YrQ7j2a
+
+#### 5.注释
+
+1.route目录下的文件需要加上文件头部注释(写清楚文件是什么功能)
+2.component文件需要加上头部注释 (写清楚改控件的用处)
\ No newline at end of file
diff --git a/admin-web/README.ru-RU.md b/admin-web/README.ru-RU.md
deleted file mode 100644
index 22d16c9ac..000000000
--- a/admin-web/README.ru-RU.md
+++ /dev/null
@@ -1,103 +0,0 @@
-[English](./README.md) | [简体中文](./README.zh-CN.md) | Русский
-
-
](http://godban.github.io/browsers-support-badges/)IE / Edge | [
](http://godban.github.io/browsers-support-badges/)Firefox | [
](http://godban.github.io/browsers-support-badges/)Chrome | [
](http://godban.github.io/browsers-support-badges/)Safari | [
](http://godban.github.io/browsers-support-badges/)Opera |
-| --------- | --------- | --------- | --------- | --------- |
-| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
-
-## Распространение
-
-Любые варианты распространения приветствуются! Вот несколько примеров того, как вы можете помочь распространению проекта:
-
-- Использовать Ant Design Pro в ежедневной работе.
-- Создавать [задачи](http://github.com/ant-design/ant-design-pro/issues) заводить баги или отвечать на вопросы.
-- Делать [pull-реквесты](http://github.com/ant-design/ant-design-pro/pulls) для совершенствования нашего кода.
diff --git a/admin-web/README.zh-CN.md b/admin-web/README.zh-CN.md
deleted file mode 100644
index 6b1505061..000000000
--- a/admin-web/README.zh-CN.md
+++ /dev/null
@@ -1,121 +0,0 @@
-[English](./README.md) | 简体中文 | [Русский](./README.ru-RU.md)
-
-
](http://godban.github.io/browsers-support-badges/)IE / Edge | [
](http://godban.github.io/browsers-support-badges/)Firefox | [
](http://godban.github.io/browsers-support-badges/)Chrome | [
](http://godban.github.io/browsers-support-badges/)Safari | [
](http://godban.github.io/browsers-support-badges/)Opera |
-| --------- | --------- | --------- | --------- | --------- |
-| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
-
-## 参与贡献
-
-我们非常欢迎你的贡献,你可以通过以下方式和我们一起共建 :smiley::
-
-- 在你的公司或个人项目中使用 Ant Design Pro。
-- 通过 [Issue](http://github.com/ant-design/ant-design-pro/issues) 报告 bug 或进行咨询。
-- 提交 [Pull Request](http://github.com/ant-design/ant-design-pro/pulls) 改进 Pro 的代码。
diff --git a/admin-web/helpers/validator.js b/admin-web/helpers/validator.js
new file mode 100644
index 000000000..02bc4b81c
--- /dev/null
+++ b/admin-web/helpers/validator.js
@@ -0,0 +1,10 @@
+
+// 校验必须是英文或者数字
+export function checkTypeWithEnglishAndNumbers (rule, value, callback, text) {
+ let char = /^[a-zA-Z0-9]+$/
+ if (char.test(value)) {
+ callback()
+ } else {
+ callback(text)
+ }
+}
\ No newline at end of file
diff --git a/admin-web/mock/admin.js b/admin-web/mock/admin.js
index aa30f8d3d..be9c114b2 100644
--- a/admin-web/mock/admin.js
+++ b/admin-web/mock/admin.js
@@ -49,10 +49,10 @@ function getDictionaryTree(req, res) {
}
export default {
- 'GET /admin-api/admins/admin/menu_resource_tree': getAdminMenu,
+ 'GET /admin-api/admins/admin/menu_resource_tree': getAdminMenuAll,
'GET /admin-api/admins/admin/url_resource_list': getAdminUrls,
'GET /admin-api/admins/resource/tree': getResourceTree,
'GET /admin-api/admins/role/page': getQueryRole,
- 'GET /admin-api/admins/admin/page': getQueryRole,
+ // 'GET /admin-api/admins/admin/page': getQueryRole,
'GET /admin-api/admins/data_dict/tree': getDictionaryTree,
};
diff --git a/admin-web/src/components/Dictionary/DictionaryText.js b/admin-web/src/components/Dictionary/DictionaryText.js
index 9ee99f2df..7faf7e329 100644
--- a/admin-web/src/components/Dictionary/DictionaryText.js
+++ b/admin-web/src/components/Dictionary/DictionaryText.js
@@ -5,6 +5,7 @@ export default class DictionaryText extends PureComponent {
componentDidMount() {}
render() {
+ debugger;
const { dicKey, dicValue } = this.props;
return (
If included via a RequestDispatcher, the current resource will see the + * originating request. Its own URI and paths are exposed as request attributes. + */ + public static final String INCLUDE_REQUEST_URI_ATTRIBUTE = "javax.servlet.include.request_uri"; + public static final String INCLUDE_CONTEXT_PATH_ATTRIBUTE = "javax.servlet.include.context_path"; +// public static final String INCLUDE_SERVLET_PATH_ATTRIBUTE = "javax.servlet.include.servlet_path"; +// public static final String INCLUDE_PATH_INFO_ATTRIBUTE = "javax.servlet.include.path_info"; +// public static final String INCLUDE_QUERY_STRING_ATTRIBUTE = "javax.servlet.include.query_string"; +// +// /** +// * Standard Servlet 2.4+ spec request attributes for forward URI and paths. +// *
If forwarded to via a RequestDispatcher, the current resource will see its
+// * own URI and paths. The originating URI and paths are exposed as request attributes.
+// */
+// public static final String FORWARD_REQUEST_URI_ATTRIBUTE = "javax.servlet.forward.request_uri";
+// public static final String FORWARD_CONTEXT_PATH_ATTRIBUTE = "javax.servlet.forward.context_path";
+// public static final String FORWARD_SERVLET_PATH_ATTRIBUTE = "javax.servlet.forward.servlet_path";
+// public static final String FORWARD_PATH_INFO_ATTRIBUTE = "javax.servlet.forward.path_info";
+// public static final String FORWARD_QUERY_STRING_ATTRIBUTE = "javax.servlet.forward.query_string";
+
+ /**
+ * Default character encoding to use when As the value returned by The URI that the web container resolves should be correct, but some
+ * containers like JBoss/Jetty incorrectly include ";" strings like ";jsessionid"
+ * in the URI. This method cuts off such incorrect appendices.
+ *
+ * @param request current HTTP request
+ * @return the request URI
+ */
+ public static String getRequestUri(HttpServletRequest request) {
+ String uri = (String) request.getAttribute(INCLUDE_REQUEST_URI_ATTRIBUTE);
+ if (uri == null) {
+ uri = request.getRequestURI();
+ }
+ return normalize(decodeAndCleanUriString(request, uri));
+ }
+
+ /**
+ * Normalize a relative URI path that may have relative values ("/./",
+ * "/../", and so on ) it it. WARNING - This method is
+ * useful only for normalizing application-generated paths. It does not
+ * try to perform security checks for malicious input.
+ * Normalize operations were was happily taken from org.apache.catalina.util.RequestUtil in
+ * Tomcat trunk, r939305
+ *
+ * @param path Relative path to be normalized
+ * @return normalized path
+ */
+ public static String normalize(String path) {
+ return normalize(path, true);
+ }
+
+ /**
+ * Normalize a relative URI path that may have relative values ("/./",
+ * "/../", and so on ) it it. WARNING - This method is
+ * useful only for normalizing application-generated paths. It does not
+ * try to perform security checks for malicious input.
+ * Normalize operations were was happily taken from org.apache.catalina.util.RequestUtil in
+ * Tomcat trunk, r939305
+ *
+ * @param path Relative path to be normalized
+ * @param replaceBackSlash Should '\\' be replaced with '/'
+ * @return normalized path
+ */
+ private static String normalize(String path, boolean replaceBackSlash) {
+
+ if (path == null)
+ return null;
+
+ // Create a place for the normalized path
+ String normalized = path;
+
+ if (replaceBackSlash && normalized.indexOf('\\') >= 0)
+ normalized = normalized.replace('\\', '/');
+
+ if (normalized.equals("/."))
+ return "/";
+
+ // Add a leading "/" if necessary
+ if (!normalized.startsWith("/"))
+ normalized = "/" + normalized;
+
+ // Resolve occurrences of "//" in the normalized path
+ while (true) {
+ int index = normalized.indexOf("//");
+ if (index < 0)
+ break;
+ normalized = normalized.substring(0, index) +
+ normalized.substring(index + 1);
+ }
+
+ // Resolve occurrences of "/./" in the normalized path
+ while (true) {
+ int index = normalized.indexOf("/./");
+ if (index < 0)
+ break;
+ normalized = normalized.substring(0, index) +
+ normalized.substring(index + 2);
+ }
+
+ // Resolve occurrences of "/../" in the normalized path
+ while (true) {
+ int index = normalized.indexOf("/../");
+ if (index < 0)
+ break;
+ if (index == 0)
+ return (null); // Trying to go outside our context
+ int index2 = normalized.lastIndexOf('/', index - 1);
+ normalized = normalized.substring(0, index2) +
+ normalized.substring(index + 3);
+ }
+
+ // Return the normalized path that we have completed
+ return (normalized);
+ }
+
+ /**
+ * Decode the supplied URI string and strips any extraneous portion after a ';'.
+ *
+ * @param request the incoming HttpServletRequest
+ * @param uri the application's URI string
+ * @return the supplied URI string stripped of any extraneous portion after a ';'.
+ */
+ private static String decodeAndCleanUriString(HttpServletRequest request, String uri) {
+ uri = decodeRequestString(request, uri);
+ int semicolonIndex = uri.indexOf(';');
+ return (semicolonIndex != -1 ? uri.substring(0, semicolonIndex) : uri);
+ }
+
+ /**
+ * Return the context path for the given request, detecting an include request
+ * URL if called within a RequestDispatcher include.
+ * As the value returned by The default implementation uses The default implementation checks the request's
+ * {@link ServletRequest#getCharacterEncoding() character encoding}, and if that
+ * request.getCharacterEncoding
+ * returns null, according to the Servlet spec.
+ *
+ * @see javax.servlet.ServletRequest#getCharacterEncoding
+ */
+ public static final String DEFAULT_CHARACTER_ENCODING = "ISO-8859-1";
+
public static String obtainAccess(HttpServletRequest request) {
String authorization = request.getHeader("Authorization");
if (!StringUtils.hasText(authorization)) {
@@ -39,4 +77,243 @@ public class HttpUtil {
return request.getRemoteAddr();
}
+ /**
+ * @param request 请求
+ * @return ua
+ */
+ public static String getUserAgent(HttpServletRequest request) {
+ String ua = request.getHeader("User-Agent");
+ return ua != null ? ua : "";
+ }
+
+ /**
+ * 根据request拼接queryString
+ *
+ * @return queryString
+ */
+ @SuppressWarnings("unchecked")
+ public static String buildQueryString(HttpServletRequest request) {
+ Enumerationhttp://www.somehost.com/myapp/my/url.jsp,
+ *
+ * for an application deployed to /mayapp (the application's context path), this method would return
+ *
+ * /my/url.jsp.
+ *
+ * 该方法,是从 Shiro 源码中,扣出来。add by 芋艿
+ *
+ * @param request current HTTP request
+ * @return the path within the web application
+ */
+ public static String getPathWithinApplication(HttpServletRequest request) {
+ String contextPath = getContextPath(request);
+ String requestUri = getRequestUri(request);
+ if (StringUtils.startsWithIgnoreCase(requestUri, contextPath)) {
+ // Normal case: URI contains context path.
+ String path = requestUri.substring(contextPath.length());
+ return (StringUtils.hasText(path) ? path : "/");
+ } else {
+ // Special case: rather unusual.
+ return requestUri;
+ }
+ }
+
+ /**
+ * Return the request URI for the given request, detecting an include request
+ * URL if called within a RequestDispatcher include.
+ * request.getRequestURI() is not
+ * decoded by the servlet container, this method will decode it.
+ * request.getContextPath() is not
+ * decoded by the servlet container, this method will decode it.
+ *
+ * @param request current HTTP request
+ * @return the context path
+ */
+ public static String getContextPath(HttpServletRequest request) {
+ String contextPath = (String) request.getAttribute(INCLUDE_CONTEXT_PATH_ATTRIBUTE);
+ if (contextPath == null) {
+ contextPath = request.getContextPath();
+ }
+ if ("/".equals(contextPath)) {
+ // Invalid case, but happens for includes on Jetty: silently adapt it.
+ contextPath = "";
+ }
+ return decodeRequestString(request, contextPath);
+ }
+
+ /**
+ * Decode the given source string with a URLDecoder. The encoding will be taken
+ * from the request, falling back to the default "ISO-8859-1".
+ * URLDecoder.decode(input, enc).
+ *
+ * @param request current HTTP request
+ * @param source the String to decode
+ * @return the decoded String
+ * @see #DEFAULT_CHARACTER_ENCODING
+ * @see javax.servlet.ServletRequest#getCharacterEncoding
+ * @see java.net.URLDecoder#decode(String, String)
+ * @see java.net.URLDecoder#decode(String)
+ */
+ @SuppressWarnings({"deprecation"})
+ public static String decodeRequestString(HttpServletRequest request, String source) {
+ String enc = determineEncoding(request);
+ try {
+ return URLDecoder.decode(source, enc);
+ } catch (UnsupportedEncodingException ex) {
+ if (logger.isWarnEnabled()) {
+ logger.warn("Could not decode request string [" + source + "] with encoding '" + enc +
+ "': falling back to platform default encoding; exception message: " + ex.getMessage());
+ }
+ return URLDecoder.decode(source);
+ }
+ }
+
+ /**
+ * Determine the encoding for the given request.
+ * Can be overridden in subclasses.
+ * null, falls back to the {@link #DEFAULT_CHARACTER_ENCODING}.
+ *
+ * @param request current HTTP request
+ * @return the encoding for the request (never null)
+ * @see javax.servlet.ServletRequest#getCharacterEncoding()
+ */
+ protected static String determineEncoding(HttpServletRequest request) {
+ String enc = request.getCharacterEncoding();
+ if (enc == null) {
+ enc = DEFAULT_CHARACTER_ENCODING;
+ }
+ return enc;
+ }
+
}
\ No newline at end of file
diff --git a/common/common-framework/src/main/java/cn/iocoder/common/framework/util/StringUtil.java b/common/common-framework/src/main/java/cn/iocoder/common/framework/util/StringUtil.java
index 8e98169ed..c81be713f 100644
--- a/common/common-framework/src/main/java/cn/iocoder/common/framework/util/StringUtil.java
+++ b/common/common-framework/src/main/java/cn/iocoder/common/framework/util/StringUtil.java
@@ -27,4 +27,8 @@ public class StringUtil {
return array;
}
+ public static String substring(String str, int start) {
+ return org.apache.commons.lang3.StringUtils.substring(str, start);
+ }
+
}
\ No newline at end of file
diff --git a/product/product-application/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java b/product/product-application/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java
index 0c64f6dab..d598b03dd 100644
--- a/product/product-application/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java
+++ b/product/product-application/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java
@@ -52,7 +52,7 @@ public class AdminsProductSpuController {
@RequestParam("sellPoint") String sellPoint,
@RequestParam("description") String description,
@RequestParam("cid") Integer cid,
- @RequestParam("picURLs") List