guomingze 2 سال پیش
کامیت
467db27011
100فایلهای تغییر یافته به همراه1798 افزوده شده و 0 حذف شده
  1. 29 0
      .gitignore
  2. 125 0
      .setting.xml
  3. 1 0
      README.md
  4. 118 0
      boot_platform_pro.sql
  5. 9 0
      jeesharp-module/api-gateway/README.md
  6. 50 0
      jeesharp-module/api-gateway/pom.xml
  7. 55 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/file/FileApiController.java
  8. 97 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/login/LoginAppApiController.java
  9. 109 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/login/LoginCodeApiController.java
  10. 178 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/login/LoginWeChatApiController.java
  11. 73 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/user/UserApicontroller.java
  12. 40 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/common/DictCommonApiController.java
  13. 24 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/common/StatusCommonApiController.java
  14. 94 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/common/VerifyCodeCommonApiController.java
  15. 70 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/login/LoginSysController.java
  16. 185 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/JWTAuthorizingRealm.java
  17. 116 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/JWTFilter.java
  18. 23 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/JWTToken.java
  19. 92 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/JWTUtil.java
  20. 210 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/SysApiAuthenticationFilter.java
  21. 26 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/user/UserSysController.java
  22. 29 0
      jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/util/MobileUtils.java
  23. 10 0
      jeesharp-module/api-gateway/src/main/resources/application-api.yml
  24. 1 0
      jeesharp-module/api-gateway/src/main/resources/templates/modules/api/index.html
  25. 1 0
      jeesharp-module/jeesharp-front/READ.ME
  26. 33 0
      jeesharp-module/jeesharp-front/pom.xml
  27. 0 0
      jeesharp-module/jeesharp-front/src/main/resources/front/css/app.7971f7ce.css
  28. 0 0
      jeesharp-module/jeesharp-front/src/main/resources/front/css/chunk-vendors.ceb99a7e.css
  29. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/favicon.ico
  30. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/fonts/element-icons.535877f5.woff
  31. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/fonts/element-icons.732389de.ttf
  32. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/1.c77db050.png
  33. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/10_23.801ad90b.png
  34. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/11_24.b8f25609.png
  35. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/12_25.320bde46.png
  36. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/1_03.0c08158d.png
  37. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/2.238059e6.png
  38. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/2_03.390026ff.png
  39. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/3.3127c627.png
  40. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/3_05.c6f074fd.png
  41. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/4.e7431058.png
  42. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/4_09.6e56a21b.png
  43. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/5.a975ba56.png
  44. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/5_11.52999972.png
  45. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/6_13.d6b7ed21.png
  46. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/7_17.73308f2f.png
  47. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/8_18.8bf27f74.png
  48. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/9_19.db3e3b1e.png
  49. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/Illustration1.a18f68ca.png
  50. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/Illustration2.51a615f6.png
  51. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/Illustration3.29f18f5d.png
  52. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/aly.8a32f5ca.png
  53. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/banner.7d0a926e.png
  54. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/buzny.ef2fb5b2.jpg
  55. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/chanpinbanner.53b8640d.png
  56. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/gjdw.3dc50c16.jpg
  57. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/goodle.27b2be0b.jpg
  58. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/hr.a83ce417.jpg
  59. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/hw.f1222bf8.jpg
  60. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_1.00f1f4cc.png
  61. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_1.7dca9d89.png
  62. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_1.d06cb3a3.png
  63. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_1.dce4c00f.png
  64. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_10.454bbe18.png
  65. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_10.55661ac1.png
  66. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_11.5fd895d9.png
  67. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_12.f2314353.png
  68. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_13.6c347332.png
  69. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_14.e07c7599.png
  70. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_15.4e79c4cb.png
  71. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_16.a37d1197.png
  72. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_17.40ff0c83.png
  73. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_2.02600a93.png
  74. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_2.4698ac0b.png
  75. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_2.f18d7d37.png
  76. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_20.054c473a.png
  77. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_22.66c721e8.png
  78. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_24.42d2a526.png
  79. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_25.4243f9c4.png
  80. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_26.1b259366.png
  81. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_3.60476f75.png
  82. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_3.91cb2abd.png
  83. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_3.f621a3e4.png
  84. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_4.3df16dac.png
  85. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_4.bb66f00b.png
  86. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_4.d3a65a12.png
  87. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_5.32f917b4.png
  88. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_5.35a12977.png
  89. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_5.439b1190.png
  90. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_6.5e9c8762.png
  91. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_6.746bf200.png
  92. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_7.104deece.png
  93. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_7.5e817d1c.png
  94. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_8.860ef222.png
  95. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_9.498f23a8.png
  96. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_9.880b2cd6.png
  97. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/icona.dd08fad3.png
  98. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/iconb.7461bc2e.png
  99. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/iconf.48222a56.png
  100. BIN
      jeesharp-module/jeesharp-front/src/main/resources/front/img/logo.f84d58a7.png

+ 29 - 0
.gitignore

@@ -0,0 +1,29 @@
+# Created by .ignore support plugin (hsz.mobi)
+.idea
+**/target
+**/target/**
+**/**/target
+**/**/target/**
+
+*.iml
+**/*.iml
+**/**/*.iml
+**/*.iml
+
+./360Downloads
+./360Downloads/**
+360Downloads
+360Downloads/**
+
+
+/downloads
+/downloads/**
+
+target
+
+/temp/
+/temp/**
+
+log.path_IS_UNDEFINED
+
+/log.path_IS_UNDEFINED

+ 125 - 0
.setting.xml

@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+    <mirrors>
+        <mirror>
+            <id>mirror</id>
+            <mirrorOf>central,jcenter,!rdc-releases,!rdc-snapshots</mirrorOf>
+            <name>mirror</name>
+            <url>https://maven.aliyun.com/nexus/content/groups/public</url>
+        </mirror>
+    </mirrors>
+    <servers>
+        <server>
+            <id>rdc-releases</id>
+            <username>6051cb7cc41f5c36db929c1a</username>
+            <password>m8ZiHSRU1GbJ</password>
+        </server>
+        <server>
+            <id>rdc-snapshots</id>
+            <username>6051cb7cc41f5c36db929c1a</username>
+            <password>m8ZiHSRU1GbJ</password>
+        </server>
+    </servers>
+    <profiles>
+        <profile>
+            <id>rdc</id>
+            <properties>
+                <altReleaseDeploymentRepository>
+                    rdc-releases::default::https://packages.aliyun.com/maven/repository/2085629-release-VjWRxR/
+                </altReleaseDeploymentRepository>
+                <altSnapshotDeploymentRepository>
+                    rdc-snapshots::default::https://packages.aliyun.com/maven/repository/2085629-snapshot-HgflM7/
+                </altSnapshotDeploymentRepository>
+            </properties>
+            <repositories>
+                <repository>
+                    <id>central</id>
+                    <url>https://maven.aliyun.com/nexus/content/groups/public</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>false</enabled>
+                    </snapshots>
+                </repository>
+                <repository>
+                    <id>snapshots</id>
+                    <url>https://maven.aliyun.com/nexus/content/groups/public</url>
+                    <releases>
+                        <enabled>false</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </repository>
+                <repository>
+                    <id>rdc-releases</id>
+                    <url>https://packages.aliyun.com/maven/repository/2085629-release-VjWRxR/</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>false</enabled>
+                    </snapshots>
+                </repository>
+                <repository>
+                    <id>rdc-snapshots</id>
+                    <url>https://packages.aliyun.com/maven/repository/2085629-snapshot-HgflM7/</url>
+                    <releases>
+                        <enabled>false</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </repository>
+            </repositories>
+            <pluginRepositories>
+                <pluginRepository>
+                    <id>central</id>
+                    <url>https://maven.aliyun.com/nexus/content/groups/public</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>false</enabled>
+                    </snapshots>
+                </pluginRepository>
+                <pluginRepository>
+                    <id>snapshots</id>
+                    <url>https://maven.aliyun.com/nexus/content/groups/public</url>
+                    <releases>
+                        <enabled>false</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </pluginRepository>
+                <pluginRepository>
+                    <id>rdc-releases</id>
+                    <url>https://packages.aliyun.com/maven/repository/2085629-release-VjWRxR/</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>false</enabled>
+                    </snapshots>
+                </pluginRepository>
+                <pluginRepository>
+                    <id>rdc-snapshots</id>
+                    <url>https://packages.aliyun.com/maven/repository/2085629-snapshot-HgflM7/</url>
+                    <releases>
+                        <enabled>false</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </pluginRepository>
+            </pluginRepositories>
+        </profile>
+    </profiles>
+    <activeProfiles>
+        <activeProfile>rdc</activeProfile>
+    </activeProfiles>
+</settings>

+ 1 - 0
README.md

@@ -0,0 +1 @@
+欢迎创建柠檬云,创建日期:Mon Jul 11 13:37:41 CST 2022

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 118 - 0
boot_platform_pro.sql


+ 9 - 0
jeesharp-module/api-gateway/README.md

@@ -0,0 +1,9 @@
+#接口
+##前段接口格式:https://api.sxidc.com
+###登录地址:
+   账号密码:/apiApp/1/login
+   小程序登录:
+  
+
+
+##pc端接口格式:https://api.sxidc.com/apiSys/1/

+ 50 - 0
jeesharp-module/api-gateway/pom.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>jeesharp-module</artifactId>
+        <groupId>org.jeesharp.module</groupId>
+        <version>${jeesharp.module.version}</version>
+    </parent>
+
+    <artifactId>api-gateway</artifactId>
+    <name>api-gateway</name>
+    <!-- FIXME change it to the project's website -->
+    <url>http://www.example.com</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+		<dependency>
+            <groupId>org.jeesharp.module</groupId>
+            <artifactId>jeesharp-member</artifactId>
+            <version>${jeesharp.module.version}</version>
+        </dependency> 
+       <dependency>
+            <groupId>org.jeesharp.module</groupId>
+            <artifactId>jeesharp-front</artifactId>
+            <version>${jeesharp.module.version}</version>
+        </dependency> 
+       <dependency>
+  <groupId>org.jeesharp.plugins</groupId>
+  <artifactId>jeesharp-dashboard</artifactId>
+  <version>${jeesharp.platform.version}</version>
+</dependency> 
+       <dependency>
+  <groupId>org.jeesharp.plugins</groupId>
+  <artifactId>jeesharp-quartz</artifactId>
+  <version>${jeesharp.plugins.version}</version>
+</dependency> 
+       <dependency>
+  <groupId>org.jeesharp.plugins</groupId>
+  <artifactId>jeesharp-datasource</artifactId>
+  <version>${jeesharp.plugins.version}</version>
+</dependency> 
+       
+    </dependencies>
+</project>

+ 55 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/file/FileApiController.java

@@ -0,0 +1,55 @@
+package com.jeesharp.modules.api.app.file;
+
+
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.common.utils.io.FileUtils;
+import com.jeesharp.config.properties.JeesharpProperites;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.modules.member.utils.ApiUserUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
+
+/**
+ * @author qiyuan
+ */
+@Api(tags = "文件上传")
+@RestController
+@RequestMapping("/apiApp/{code}/file")
+public class FileApiController extends BaseController {
+
+
+    @ApiOperation("1.1 文件上传")
+    @PostMapping(value = "upload")
+    public AjaxResult imageUpload(HttpServletRequest request, MultipartFile file) {
+        // 判断文件是否为空
+        if (!file.isEmpty()) {
+            String userfilesBaseDir = JeesharpProperites.newInstance().getUserfilesBaseDir();
+            // 文件保存路径
+            String realPath = JeesharpProperites.USERFILES_BASE_URL + ApiUserUtils.getApiUser().getId() + File.separator;
+            // 创建文件
+            FileUtils.createDirectory(userfilesBaseDir + realPath);
+            try {
+                String fileName = file.getOriginalFilename();
+                String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
+                String newFileName = UUID.randomUUID() + "." + suffix;
+                String filePath = realPath + newFileName;
+                file.transferTo(new File(userfilesBaseDir + filePath));
+                return AjaxResult.createBySuccess(filePath);
+            } catch (IOException e) {
+                return AjaxResult.createByErrorMessge("上传失败");
+            }
+        }
+        return AjaxResult.createByErrorMessge("文件为空");
+    }
+
+
+}

+ 97 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/login/LoginAppApiController.java

@@ -0,0 +1,97 @@
+package com.jeesharp.modules.api.app.login;
+
+import com.jeesharp.common.constant.ResponseCode;
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.common.utils.PasswordUtils;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.modules.member.utils.VerifyCodeUtils;
+import com.jeesharp.modules.member.utils.ApiUserUtils;
+import com.jeesharp.modules.member.constant.LoginType;
+import com.jeesharp.modules.member.dto.LoginH5Dto;
+import com.jeesharp.modules.member.entity.Member;
+import com.jeesharp.modules.member.service.MemberService;
+import io.swagger.annotations.*;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 如果不知道appid什么意思,请直接让前段赋值给1;例如;https://api.sxidc.com/apiApp/1/
+ * @author qiyuan
+ */
+@Api(tags = "用户登录")
+@Controller
+@RequestMapping("/apiApp/{code}/")
+public class LoginAppApiController extends BaseController {
+
+    private final MemberService memberService;
+
+    public LoginAppApiController(MemberService memberService ){
+        this.memberService = memberService;
+    }
+
+    /***
+     * app或者h5登录
+     * @param loginDto
+     * @return
+     */
+    @ResponseBody
+    @ApiOperation("1.1 app或者h5登录")
+    @PostMapping("login")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "loginName", value = "登录账号或者手机号码", dataType = "string",   paramType = "query", required = true, defaultValue = ""),
+            @ApiImplicitParam(name = "password", value = "密码", dataType = "string", paramType = "query",required = false, defaultValue = ""),
+            @ApiImplicitParam(name = "type", value = "登录类型;1账号密码,2验证码", dataType = "string",   paramType = "query", required = true, defaultValue = "1"),
+            @ApiImplicitParam(name = "smsCode", value = "短信验证码", dataType = "string", paramType = "query",   required = true, defaultValue = "")})
+    @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = AjaxResult.class) })
+    public AjaxResult login(@Validated LoginH5Dto loginDto){
+        Member member;
+        if(LoginType.PWD_LOGIN.getCode().equals(loginDto.getType())){
+            member = memberService.getByLoginName(loginDto.getLoginName());
+            if (member == null) {
+                return AjaxResult.fail(ResponseCode.ERROR.getCode(), "账号不存在");
+            }
+            if (!PasswordUtils.validatePassword(loginDto.getPassword() ,member.getPassword())) {
+                return AjaxResult.fail(ResponseCode.ERROR.getCode(), "账号密码错误");
+            }
+        } else{
+            if (!loginDto.getSmsCode().equals(VerifyCodeUtils.getSmsCode(loginDto.getLoginName()))) {
+                return AjaxResult.failMsg("验证码错误");
+            }
+            member = memberService.getByLoginName(loginDto.getLoginName());
+            if (member == null) {
+                member = new Member();
+                member.setLoginName(loginDto.getLoginName());
+                memberService.saveApiMember(member);
+            }
+        }
+        return AjaxResult.okData(ApiUserUtils.createLoginResponse(member));
+    }
+
+    /**
+     * 公共方法,如果需要什么自定义添加
+     * @return
+     */
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "loginName", value = "登录账号", dataType = "string",  paramType = "query", required = true, defaultValue = ""),
+            @ApiImplicitParam(name = "password", value = "密码", dataType = "string",  paramType = "query", required = false, defaultValue = ""),
+            @ApiImplicitParam(name = "type", value = "是否需要短信验证,1是0否", dataType = "string",  paramType = "query", required = true, defaultValue = "1"),
+            @ApiImplicitParam(name = "smsCode", value = "短信验证码", dataType = "string", paramType = "query", required = true, defaultValue = "")
+            })
+    @ApiOperation("1.2 注册")
+    @PostMapping(value = "register")
+    public AjaxResult register(@Validated LoginH5Dto loginDto) {
+        loginDto.setServeCode(VerifyCodeUtils.getSmsCode(loginDto.getServeCode()));
+        memberService.registerByAppOrH5(loginDto);
+        return AjaxResult.ok("注册成功");
+    }
+
+    @ApiOperation(notes = "此登录直接返回登录信息,无需输入账号密码",value = "1.3 测试登录账号")
+    @ResponseBody
+    @PostMapping("testLogin")
+    public AjaxResult testLogin(){
+        return AjaxResult.okData(ApiUserUtils.createLoginResponse(new Member("d5b74bca142e492593e536da6a86ff1a")));
+    }
+
+}

+ 109 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/login/LoginCodeApiController.java

@@ -0,0 +1,109 @@
+package com.jeesharp.modules.api.app.login;
+
+import com.jeesharp.common.exception.NotExistException;
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.modules.member.utils.VerifyCodeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Random;
+
+/**
+ * @author qiyuan
+ */
+@RequestMapping("/apiApp/{code}/")
+@RestController
+public class LoginCodeApiController extends BaseController {
+
+
+    /**
+     *  根据手机号码获取验证码
+     * @param phone
+     * @return
+     */
+    @GetMapping("/smsCode")
+    public AjaxResult getSmsCode(String phone){
+       return AjaxResult.createBySuccess();
+    }
+
+    /**
+     *  获取图形验证码
+     * @return
+     */
+    @GetMapping("imageCode")
+    public void getImageCode(String loginName ,HttpServletRequest request, HttpServletResponse response) throws IOException {
+        if (StringUtils.isBlank(loginName)) {
+            throw new NotExistException("账号不能为空");
+        }
+        int w = 70;
+        int h = 26;
+        response.setHeader("Pragma", "no-cache");
+        response.setHeader("Cache-Control", "no-cache");
+        response.setDateHeader("Expires", 0);
+        response.setContentType("image/jpeg");
+        /*
+         * 得到参数高,宽,都为数字时,则使用设置高宽,否则使用默认值
+         */
+        String width = request.getParameter("width");
+        String height = request.getParameter("height");
+        if (StringUtils.isNumeric(width) && StringUtils.isNumeric(height)) {
+            w = NumberUtils.toInt(width);
+            h = NumberUtils.toInt(height);
+        }
+        BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+        Graphics g = image.getGraphics();
+        /*
+         * 生成背景
+         */
+        createBackground(w ,h ,g);
+        /*
+         * 生成字符
+         */
+        VerifyCodeUtils.createImageCode(g ,loginName);
+        g.dispose();
+        OutputStream out = response.getOutputStream();
+        ImageIO.write(image, "JPEG", out);
+        out.close();
+    }
+
+
+    private Color getRandColor(int fc,int bc) {
+        int f = fc;
+        int b = bc;
+        Random random=new Random();
+        if(f>255) {
+            f=255;
+        }
+        if(b>255) {
+            b=255;
+        }
+        return new Color(f+random.nextInt(b-f),f+random.nextInt(b-f),f+random.nextInt(b-f));
+    }
+
+    private void createBackground(int w, int h, Graphics g) {
+        // 填充背景
+        g.setColor(getRandColor(220,250));
+        g.fillRect(0, 0, w, h);
+        // 加入干扰线条
+        for (int i = 0; i < 8; i++) {
+            g.setColor(getRandColor(40,150));
+            Random random = new Random();
+            int x = random.nextInt(w);
+            int y = random.nextInt(h);
+            int x1 = random.nextInt(w);
+            int y1 = random.nextInt(h);
+            g.drawLine(x, y, x1, y1);
+        }
+    }
+}

+ 178 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/login/LoginWeChatApiController.java

@@ -0,0 +1,178 @@
+package com.jeesharp.modules.api.app.login;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
+import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
+import com.jeesharp.common.constant.ResponseCode;
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.common.utils.EmojiRecoveryUtils;
+import com.jeesharp.common.utils.PasswordUtils;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.modules.member.utils.VerifyCodeUtils;
+import com.jeesharp.modules.member.constant.LoginType;
+import com.jeesharp.modules.member.utils.ApiUserUtils;
+import com.jeesharp.modules.member.entity.Member;
+import com.jeesharp.modules.member.service.MemberService;
+import com.jeesharp.modules.wechat.api.WeixinOpenService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * 
+ * @author qiyuan
+ */
+@Controller
+@Api(tags = "用户登录")
+@RequestMapping("/apiApp/{code}/wechat")
+public class LoginWeChatApiController extends BaseController {
+
+    private final MemberService memberService;
+    private final WeixinOpenService weixinOpenService;
+
+    public LoginWeChatApiController(MemberService memberService , WeixinOpenService weixinOpenService){
+        this.memberService = memberService;
+        this.weixinOpenService = weixinOpenService;
+    }
+
+    /***
+     * 小程序登录:类型值:3:没有关联开放平台的小程序登录 4:关联开放平台的小程序登录
+     * @param code 账号
+     * @param type 密码
+     * @param encryptedData 小程序返回的
+     * @param ivStr 小程序返回的
+     * @return
+     */
+    @ResponseBody
+    @ApiOperation("2.2 小程序登录")
+    @PostMapping("login")
+    public AjaxResult login(String code, String type, String encryptedData, String ivStr, String appid){
+        Member member = null;
+        if(LoginType.MINI_LOGIN_NOAUTO.getCode().equals(type)){
+            WxMaService wxMaService = weixinOpenService.getMiniService(appid);
+            try {
+                WxMaJscode2SessionResult session = wxMaService.jsCode2SessionInfo(code);
+                WxMaUserInfo wxMaUserInfo = wxMaService.getUserService().getUserInfo(session.getSessionKey(), encryptedData, ivStr);
+                member = memberService.getByMiniOpenid(wxMaUserInfo.getOpenId());
+                if (member == null) {
+                    member = new Member();
+                    member.setName(EmojiRecoveryUtils.emojiConvert(wxMaUserInfo.getNickName()));
+                    member.setSex(wxMaUserInfo.getGender());
+                    member.setMiniOpenid(wxMaUserInfo.getOpenId());
+                    memberService.saveApiMember(member);
+                }
+            } catch (WxErrorException e){
+
+            }
+        } else if(LoginType.MINI_LOGIN_AUTH.getCode().equals(type)){
+            WxMaService wxMaService = weixinOpenService.getMiniService(appid);
+            try {
+                WxMaJscode2SessionResult session = wxMaService.jsCode2SessionInfo(code);
+                WxMaUserInfo wxMaUserInfo = wxMaService.getUserService().getUserInfo(session.getSessionKey(), encryptedData, ivStr);
+                member = memberService.getByUnionid(wxMaUserInfo.getOpenId());
+                if (member == null) {
+                    member = new Member();
+                    member.setUnionid(wxMaUserInfo.getUnionId());
+                    member.setName(EmojiRecoveryUtils.emojiConvert(wxMaUserInfo.getNickName()));
+                    member.setSex(wxMaUserInfo.getGender());
+                    member.setMiniOpenid(wxMaUserInfo.getOpenId());
+                    memberService.saveApiMember(member);
+                }
+            } catch (WxErrorException e){
+
+            }
+        }
+        return AjaxResult.createBySuccess(ApiUserUtils.createLoginResponse(member));
+    }
+
+    /***
+     * 小程序登录隐形登录,有则返回用户信息,没的话就不要处理
+     * @param code
+     * @return
+     */
+    @ResponseBody
+    @ApiOperation("2.4 小程序登录隐形登录")
+    @PostMapping("miniLogin")
+    public AjaxResult miniLogin(@RequestBody Map<String,String> param) throws WxErrorException{
+        /** code登录 */
+        if (StringUtils.isBlank(param.get("code"))) {
+            return AjaxResult.createByErrorMessge("empty jscode");
+        }
+        WxMaService wxMaService = weixinOpenService.getMiniService(param.get("appId"));
+        WxMaJscode2SessionResult result = wxMaService.jsCode2SessionInfo(param.get("code"));
+        Member member = memberService.getByUnionid(result.getUnionid());
+        /**说明没有关注公众号  或者 用户直接进入小程序的*/
+        if (member == null) {
+            member = memberService.getByMiniOpenid(result.getOpenid());
+        }
+        if (member == null) {
+            return AjaxResult.createByErrorCodeMessage(ResponseCode.OTHER.getCode()
+                    ,ResponseCode.OTHER.getName());
+        }
+        return AjaxResult.createBySuccess(ApiUserUtils.createLoginResponse(member));
+    }
+
+
+    @ResponseBody
+    @PostMapping("getOpenid")
+    public AjaxResult getOpenid(@RequestBody Map<String,String> param) throws WxErrorException{
+        /** code登录 */
+        if (StringUtils.isBlank(param.get("code"))) {
+            return AjaxResult.failMsg("empty jscode");
+        }
+        WxMaService wxMaService = weixinOpenService.getMiniService(param.get("appId"));
+        WxMaJscode2SessionResult result = wxMaService.jsCode2SessionInfo(param.get("code"));
+        return AjaxResult.okData(result);
+    }
+
+
+    /***
+     * 退出
+     * @return
+     * @throws IOException
+     */
+    @ApiOperation(notes = "logout", httpMethod = "POST", value = "2.3 用户退出")
+    @GetMapping(value = "logout")
+    public AjaxResult logout(){
+        ApiUserUtils.apiUserLogout();
+        return AjaxResult.createBySuccess();
+    }
+
+
+    /***
+     * 忘记密码
+     * @param phone
+     * @param code
+     * @param newPwd
+     * @return
+     */
+    @ApiOperation("2.1 忘记密码")
+    @PostMapping(value = "forgetPwd")
+    public AjaxResult forgetPwd(String phone, String code , String newPwd) throws Exception{
+        if (StringUtils.isBlank(phone)) {
+            return AjaxResult.failMsg("手机号码不能为空");
+        }
+        if (StringUtils.isBlank(code)) {
+            return AjaxResult.failMsg("验证码不能为空");
+        }
+        if (StringUtils.isBlank(newPwd)) {
+            return AjaxResult.failMsg("密码不能为空");
+        }
+        if (!code.equals(VerifyCodeUtils.getSmsCode(phone))) {
+            return AjaxResult.failMsg("验证码不正确");
+        }
+        Member member = memberService.getByMobile(phone);
+        if (member != null) {
+            member.setPassword(PasswordUtils.encryptPassword(newPwd));
+            memberService.saveApiMember(member);
+            return AjaxResult.failMsg("修改成功");
+        }
+        return AjaxResult.failMsg("用户不存在");
+    }
+}

+ 73 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/app/user/UserApicontroller.java

@@ -0,0 +1,73 @@
+package com.jeesharp.modules.api.app.user;
+
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.common.utils.io.FileUtils;
+import com.jeesharp.config.properties.JeesharpProperites;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.gateway.retention.ApiNeedAccess;
+import com.jeesharp.modules.member.utils.ApiUserUtils;
+import com.jeesharp.modules.member.entity.Member;
+import com.jeesharp.modules.member.service.MemberService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
+
+/**
+ * 不知道appid什么意思,请让前段直接给appid赋值给1
+ * @author qiyuan
+ */
+@Api(tags = "用户中心")
+@RestController
+@RequestMapping("/apiApp/{code}/user")
+public class UserApicontroller extends BaseController {
+
+
+    private final MemberService memberService;
+
+    public UserApicontroller(MemberService memberService) {
+        this.memberService = memberService;
+    }
+
+    @ApiOperation("1.1 基本信息")
+    @GetMapping(value = "info")
+    public AjaxResult info(){
+        Member member = ApiUserUtils.getApiUser();
+        return AjaxResult.okData(memberService.get(member));
+    }
+
+    @ApiOperation("1.2 修改头像")
+    @ApiNeedAccess
+    @PostMapping(value = "upload")
+    public AjaxResult imageUpload(HttpServletRequest request, MultipartFile file) {
+        Member member = ApiUserUtils.getApiUser();
+        // 判断文件是否为空
+        if (!file.isEmpty()) {
+            String userfilesBaseDir = JeesharpProperites.newInstance().getUserfilesBaseDir();
+            // 文件保存路径
+            String realPath = JeesharpProperites.USERFILES_BASE_URL + ApiUserUtils.getApiUser().getId() + File.separator;
+            // 创建文件
+            FileUtils.createDirectory(userfilesBaseDir + realPath);
+            try {
+                String fileName = file.getOriginalFilename();
+                String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
+                String newFileName = UUID.randomUUID() + "." + suffix;
+                String filePath = realPath + newFileName;
+                file.transferTo(new File(userfilesBaseDir + filePath));
+                member.setAvatar(filePath);
+                memberService.saveApiMember(member);
+                return AjaxResult.createBySuccess(filePath);
+            } catch (IOException e) {
+                return AjaxResult.createByErrorMessge("上传失败");
+            }
+        }
+        return AjaxResult.createByErrorMessge("文件为空");
+    }
+
+
+}

+ 40 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/common/DictCommonApiController.java

@@ -0,0 +1,40 @@
+package com.jeesharp.modules.api.common;
+
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.core.entity.TransformEntity;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.modules.sys.dto.DictValueDTO;
+import com.jeesharp.modules.sys.utils.DictUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author qiyuan
+ */
+@Api(tags = "公共请求")
+@RequestMapping("/commonApi/dict")
+@RestController
+public class DictCommonApiController extends BaseController {
+
+
+    /**
+     * 字典
+     * @param type
+     * @return
+     */
+    @ApiOperation(value = "字典列表",notes = "无需登录")
+    @GetMapping(value = "list")
+    @ApiResponse(code = 200,message = "", response = AjaxResult.class)
+    public AjaxResult list(@RequestParam String type) {
+        List list = DictUtils.getDictList(type);
+        return AjaxResult.okData(getJsonData((long) list.size(),
+                new TransformEntity().transformList(list,DictValueDTO.class)));
+    }
+}

+ 24 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/common/StatusCommonApiController.java

@@ -0,0 +1,24 @@
+package com.jeesharp.modules.api.common;
+
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.core.web.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author qiyuan
+ */
+@Api(tags = "公共请求")
+@RequestMapping("/commonApi/status")
+@RestController
+public class StatusCommonApiController extends BaseController {
+
+
+
+
+}

+ 94 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/common/VerifyCodeCommonApiController.java

@@ -0,0 +1,94 @@
+package com.jeesharp.modules.api.common;
+
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.common.sms.SMSUtils;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.modules.member.utils.VerifyCodeUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * @author qiyuan
+ */
+@Api(tags = "公共请求")
+@RequestMapping("/commonApi/")
+@RestController
+public class VerifyCodeCommonApiController extends BaseController {
+
+
+    /**
+     * 获取验证码
+     * @param phone
+     * @param type 默认三种值  login register forgetPwd
+     * @return
+     */
+    @ApiOperation(notes = "无需登录", httpMethod = "POST", value = "获取短信验证码")
+    @PostMapping(value = "smsCode")
+    public AjaxResult code(@RequestParam String phone, @RequestParam String type) {
+        if (StringUtils.isBlank(phone)) {
+            return AjaxResult.failMsg("手机号码不能为空");
+        }
+        String code = VerifyCodeUtils.getSmsCode(phone);
+        try {
+           /* if (!"OK".equals(SMSUtils.sendSms(type,phone,"{code,'" + code +"'}").getCode())) {
+                return AjaxResult.failMsg("发送失败");
+            }*/
+        } catch (Exception e) {
+        }
+        return AjaxResult.ok("发送成功");
+    }
+
+    /**
+     *  获取图形验证码
+     * @return
+     */
+    @ApiOperation(notes = "无需登录,输出是一张图片", httpMethod = "POST", value = "获取图形验证码")
+    @GetMapping("imageCode")
+    public void getImageCode(String appDeviceId ,HttpServletRequest request, HttpServletResponse response) throws IOException {
+        if (StringUtils.isBlank(appDeviceId)) {
+            return;
+        }
+        int w = 70;
+        int h = 26;
+        response.setHeader("Pragma", "no-cache");
+        response.setHeader("Cache-Control", "no-cache");
+        response.setDateHeader("Expires", 0);
+        response.setContentType("image/jpeg");
+        /*
+         * 得到参数高,宽,都为数字时,则使用设置高宽,否则使用默认值
+         */
+        String width = request.getParameter("width");
+        String height = request.getParameter("height");
+        if (StringUtils.isNumeric(width) && StringUtils.isNumeric(height)) {
+            w = NumberUtils.toInt(width);
+            h = NumberUtils.toInt(height);
+        }
+        BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+        Graphics g = image.getGraphics();
+        /*
+         * 生成背景
+         */
+        VerifyCodeUtils.createBackground(w ,h ,g);
+        /*
+         * 生成字符
+         */
+        VerifyCodeUtils.createImageCode(g ,appDeviceId);
+        g.dispose();
+        OutputStream out = response.getOutputStream();
+        ImageIO.write(image, "JPEG", out);
+        out.close();
+    }
+
+
+}

+ 70 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/login/LoginSysController.java

@@ -0,0 +1,70 @@
+package com.jeesharp.modules.api.sys.login;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.common.utils.IdGen;
+import com.jeesharp.common.utils.StringUtils;
+import com.jeesharp.core.servlet.ValidateCodeServlet;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.modules.sys.security.FormAuthenticationFilter;
+import com.jeesharp.modules.sys.utils.UserUtils;
+import com.jeesharp.shiro.Principal;
+import com.jeesharp.shiro.session.SessionDAO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.web.util.WebUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@RestController
+@RequestMapping("/apiSys")
+@Api(tags = {"后台用户接口"})
+public class LoginSysController extends BaseController {
+
+    @Autowired
+    private SessionDAO sessionDAO;
+
+    @ApiOperation("登录")
+    @ResponseBody
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "username" ,value = "username",paramType="query"),
+            @ApiImplicitParam(name = "password" ,value = "username",paramType="query")
+    })
+    @PostMapping("login")
+    public AjaxResult login(HttpServletRequest request, String username, String password){
+        Principal principal = UserUtils.getPrincipal();
+        // 如果已经登录,返回登录用户信息
+        if(principal != null){
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("token",principal.getSessionid());
+            jsonObject.put("user",UserUtils.getUser());
+            return AjaxResult.okData(jsonObject);
+        }
+        String message = (String)request.getAttribute(FormAuthenticationFilter.DEFAULT_MESSAGE_PARAM);
+        if (StringUtils.isBlank(message) || StringUtils.equals(message, "null")){
+            return AjaxResult.failMsg(message);
+        }
+        // 验证失败清空验证码
+        request.getSession().setAttribute(ValidateCodeServlet.VALIDATE_CODE, IdGen.uuid());
+        return  AjaxResult.failMsg(message);
+    }
+
+    @ApiOperation("退出")
+    @ResponseBody
+    @GetMapping("logout")
+    public AjaxResult logout() {
+        Principal principal = UserUtils.getPrincipal();
+        // 如果已经登录,则跳转到管理首页
+        if (principal != null) {
+            UserUtils.getSubject().logout();
+        }
+        return AjaxResult.ok("退出成功");
+    }
+}

+ 185 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/JWTAuthorizingRealm.java

@@ -0,0 +1,185 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeesharp.modules.api.sys.security;
+
+import com.jeesharp.common.utils.SpringContextHolder;
+import com.jeesharp.common.utils.security.Encodes;
+import com.jeesharp.config.properties.JeesharpProperites;
+import com.jeesharp.modules.sys.entity.User;
+import com.jeesharp.modules.sys.service.UserService;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.authc.SimpleAuthenticationInfo;
+import org.apache.shiro.authz.AuthorizationInfo;
+import org.apache.shiro.authz.Permission;
+import org.apache.shiro.realm.AuthorizingRealm;
+import org.apache.shiro.subject.PrincipalCollection;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 系统安全认证实现类
+ * @author jeeplus
+ * @version 2017-7-5
+ */
+@Service
+public class JWTAuthorizingRealm extends AuthorizingRealm {
+
+	private UserService userService;
+
+	/**
+	 * 大坑!,必须重写此方法,不然Shiro会报错
+	 */
+	@Override
+	public boolean supports(AuthenticationToken token) {
+		return token instanceof JWTToken;
+	}
+
+	/**
+	 * 认证回调函数, 登录时调用
+	 */
+	@Override
+	protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken) {
+
+		String token = (String) authcToken.getCredentials();
+		// 解密获得username,用于和数据库进行对比
+		String loginName = JWTUtil.getLoginName(token);
+		if (loginName == null) {
+			throw new AuthenticationException("无效的token");
+		}
+
+		// 校验用户
+		User user = new User();
+		user.setLoginName(loginName);
+		user = getUserService().getByLoginName(user);
+		if(user == null){
+			throw new AuthenticationException("用户不存在.");
+		}
+
+
+		if (JWTUtil.verify(token) == 1) {
+			throw new AuthenticationException("token已经过期");
+		}else if (JWTUtil.verify(token) == 2) {
+			throw new AuthenticationException("用户名或者密码错误");
+		}
+
+
+
+//		return new SimpleAuthenticationInfo(token, token, "my_realm");
+		// 校验登录验证码
+//		if ( LoginController.isValidateCodeLogin(token.getLoginName(), false, false)){
+//			Session session = UserUtils.getSession();
+//			String code = (String)session.getAttribute(ValidateCodeServlet.VALIDATE_CODE);
+//			if (token.getCaptcha() == null || !token.getCaptcha().toUpperCase().equals(code)){
+//				throw new AuthenticationException("msg:验证码错误, 请重试.");
+//			}
+//		}
+
+		// 校验用户名密码
+			if (JeesharpProperites.NO.equals(user.getLoginFlag())){
+				throw new AuthenticationException("该已帐号禁止登录.");
+			}
+			byte[] salt = Encodes.decodeHex(user.getPassword().substring(0,16));
+			return new SimpleAuthenticationInfo(token, token, getName());
+	}
+
+	/**
+	 * 授权查询回调函数, 进行鉴权但缓存中无用户的授权信息时调用
+	 */
+	@Override
+	protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
+
+//		String username = JWTUtil.getLoginName(principals.toString());
+//		// 获取当前已登录的用户
+//		User user = getUserService().getUserByLoginName(username);
+//		if (user != null) {
+//			SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
+//			List<Menu> list = UserUtils.getMenuList();
+//			for (Menu menu : list){
+//				if (StringUtils.isNotBlank(menu.getPermission())){
+//					// 添加基于Permission的权限信息
+//					for (String permission : StringUtils.split(menu.getPermission(),",")){
+//						info.addStringPermission(permission);
+//					}
+//				}
+//			}
+//			// 添加用户权限
+//			info.addStringPermission("user");
+//			// 添加用户角色信息
+//			for (Role role : user.getRoleList()){
+//				info.addRole(role.getEnname());
+//			}
+//			// 更新登录IP和时间
+//			getUserService().updateUserLoginInfo(user);
+//			// 记录登录日志
+//			LogUtils.saveLog(Servlets.getRequest(), "系统登录", LogType.LOGIN.getType());
+//			return info;
+//		} else {
+//			return null;
+//		}
+
+		return null;
+	}
+
+	@Override
+	protected void checkPermission(Permission permission, AuthorizationInfo info) {
+		authorizationValidate(permission);
+		super.checkPermission(permission, info);
+	}
+
+	@Override
+	protected boolean[] isPermitted(List<Permission> permissions, AuthorizationInfo info) {
+		if (permissions != null && !permissions.isEmpty()) {
+            for (Permission permission : permissions) {
+        		authorizationValidate(permission);
+            }
+        }
+		return super.isPermitted(permissions, info);
+	}
+
+	@Override
+	public boolean isPermitted(PrincipalCollection principals, Permission permission) {
+		authorizationValidate(permission);
+		return super.isPermitted(principals, permission);
+	}
+
+	@Override
+	protected boolean isPermittedAll(Collection<Permission> permissions, AuthorizationInfo info) {
+		if (permissions != null && !permissions.isEmpty()) {
+            for (Permission permission : permissions) {
+            	authorizationValidate(permission);
+            }
+        }
+		return super.isPermittedAll(permissions, info);
+	}
+
+	/**
+	 * 授权验证方法
+	 * @param permission
+	 */
+	private void authorizationValidate(Permission permission){
+		// 模块授权预留接口
+	}
+
+
+	@Override
+	public String getAuthorizationCacheName() {
+		return this.getClass().getSimpleName();
+	}
+
+	/**
+	 * 获取系统业务对象
+	 */
+	public UserService getUserService() {
+		if (userService == null){
+			userService = SpringContextHolder.getBean(UserService.class);
+		}
+		return userService;
+	}
+
+
+}

+ 116 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/JWTFilter.java

@@ -0,0 +1,116 @@
+package com.jeesharp.modules.api.sys.security;
+
+import com.jeesharp.common.utils.CookieUtils;
+import com.jeesharp.common.utils.StringUtils;
+import com.jeesharp.config.properties.JeesharpProperites;
+import com.jeesharp.shiro.constant.ShiroConstant;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author qiyuan
+ */
+@Service
+public class JWTFilter extends BasicHttpAuthenticationFilter {
+
+    private Logger LOGGER = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private JeesharpProperites jeesharpProperites;
+
+    /**
+     * 判断用户是否想要登入。
+     * 检测header里面是否包含Token字段即可
+     */
+    @Override
+    protected boolean isLoginAttempt(ServletRequest request, ServletResponse response) {
+        HttpServletRequest req = (HttpServletRequest) request;
+        String authorization = getToken(req);
+        return authorization != null && !"null".equals(authorization)&& !"".equals(authorization);
+    }
+
+    /**
+     *
+     */
+    @Override
+    protected boolean executeLogin(ServletRequest request, ServletResponse response) throws Exception {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+        String authorization = getToken(httpServletRequest);
+
+        JWTToken token = new JWTToken(authorization);
+        // 提交给realm进行登入,如果错误他会抛出异常并被捕获
+        getSubject(request, response).login(token);
+        // 如果没有抛出异常则代表登入成功,返回true
+        return true;
+    }
+
+    /**
+     * 获取token,支持三种方式, 请求参数、header、cookie, 优先级依次降低,以请求参数中的优先级最高。
+     * @param httpServletRequest
+     * @return
+     */
+    private String getToken(HttpServletRequest httpServletRequest){
+        String token0 = httpServletRequest.getParameter(ShiroConstant.ACCESS_TOKEN);
+        String token1 = httpServletRequest.getHeader(ShiroConstant.ACCESS_TOKEN);
+        String token2 = CookieUtils.getCookie(httpServletRequest, ShiroConstant.ACCESS_TOKEN);
+        if(StringUtils.isNotBlank(token0)){
+            return token0;
+        }
+        if(StringUtils.isNotBlank(token1)){
+            return token1;
+        }
+        if(StringUtils.isNotBlank(token2)){
+            return token2;
+        }
+       return null;
+    }
+
+
+    @Override
+    protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) {
+        if (isLoginAttempt(request, response)) {
+            try {
+               return executeLogin(request, response);
+            } catch (AuthenticationException e) {
+                //GlobalErrorController.response401(request, response);//登录超时,需要刷新token
+            }catch (Exception e){
+               //GlobalErrorController.response4021(request, response);//没有登录,需要登录
+            }
+        }else {
+            //GlobalErrorController.response4021(request, response);//没有登录,需要登录
+        }
+        return false;
+
+    }
+
+    /**
+     * 对跨域提供支持
+     */
+    @Override
+    protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
+        httpServletResponse.setHeader("Access-control-Allow-Origin", httpServletRequest.getHeader("Origin"));
+        httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS,PUT,DELETE");
+        httpServletResponse.setHeader("Access-Control-Allow-Headers", httpServletRequest.getHeader("Access-Control-Request-Headers"));
+        // 跨域时会首先发送一个option请求,这里我们给option请求直接返回正常状态
+        if (httpServletRequest.getMethod().equals(RequestMethod.OPTIONS.name())) {
+            httpServletResponse.setStatus(HttpStatus.OK.value());
+            return false;
+        }
+        return super.preHandle(request, response);
+    }
+
+
+}

+ 23 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/JWTToken.java

@@ -0,0 +1,23 @@
+package com.jeesharp.modules.api.sys.security;
+
+import org.apache.shiro.authc.AuthenticationToken;
+
+public class JWTToken implements AuthenticationToken {
+
+    // 密钥
+    private String token;
+
+    public JWTToken(String token) {
+        this.token = token;
+    }
+
+    @Override
+    public Object getPrincipal() {
+        return token;
+    }
+
+    @Override
+    public Object getCredentials() {
+        return token;
+    }
+}

+ 92 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/JWTUtil.java

@@ -0,0 +1,92 @@
+package com.jeesharp.modules.api.sys.security;
+
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.JWTVerifier;
+import com.auth0.jwt.algorithms.Algorithm;
+import com.auth0.jwt.exceptions.JWTDecodeException;
+import com.auth0.jwt.exceptions.TokenExpiredException;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import com.jeesharp.config.properties.JeesharpProperites;
+import com.jeesharp.modules.sys.utils.UserUtils;
+
+import java.util.Date;
+
+public class JWTUtil {
+    public static final String TOKEN = "token";
+
+    public static final String REFRESH_TOKEN = "refreshToken";
+
+    /**
+     * 校验token是否正确
+     * @param token 密钥
+     * @return 是否正确
+     */
+    public static int verify(String token) {
+        try {
+            String userName = JWTUtil.getLoginName(token);
+            String password = UserUtils.getByLoginName(userName).getPassword();
+            Algorithm algorithm = Algorithm.HMAC256(password);
+            JWTVerifier verifier = JWT.require(algorithm)
+                    .withClaim("username", userName)
+                    .build();
+            DecodedJWT jwt = verifier.verify(token);
+            return 0;
+        } catch (TokenExpiredException e){
+            return 1;
+        }
+        catch (Exception exception) {
+            return 2;
+        }
+    }
+
+    /**
+     * 获得token中的信息无需secret解密也能获得
+     * @return token中包含的用户名
+     */
+    public static String getLoginName(String token) {
+        try {
+            DecodedJWT jwt = JWT.decode(token);
+            return jwt.getClaim("username").asString();
+        } catch (JWTDecodeException e) {
+            return null;
+        }
+    }
+
+    /**
+     * 生成签名
+     * @param username 用户名
+     * @param password 用户的密码
+     * @return 加密的token
+     */
+    public static String createAccessToken(String username, String password) {
+            Date date = new Date(System.currentTimeMillis() + 1000000);
+            Algorithm algorithm = Algorithm.HMAC256(password);
+            // 附带username信息
+            return JWT.create()
+                    .withClaim("username", username)
+                    .withExpiresAt(date)
+                    .sign(algorithm);
+    }
+
+    /**
+     * refresh TOKEN 刷新用
+     * @param username 用户名
+     * @param password 用户的密码
+     * @return 加密的token
+     */
+    public static String createRefreshToken(String username, String password) {
+        Date date = new Date(System.currentTimeMillis() +  3 * 10000000);
+        Algorithm algorithm = Algorithm.HMAC256(password);
+        // 附带username信息
+        return JWT.create()
+                .withClaim("username", username)
+                .withExpiresAt(date)
+                .sign(algorithm);
+    }
+
+
+
+    public static void main(String[] args){
+        System.out.println(JWTUtil.createAccessToken("admin","1"));
+    }
+}

+ 210 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/security/SysApiAuthenticationFilter.java

@@ -0,0 +1,210 @@
+package com.jeesharp.modules.api.sys.security;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jeesharp.common.constant.ResponseCode;
+import com.jeesharp.common.json.ServerResponse;
+import com.jeesharp.common.mapper.JsonMapper;
+import com.jeesharp.common.utils.StringUtils;
+import com.jeesharp.modules.api.sys.util.MobileUtils;
+import com.jeesharp.modules.sys.utils.UserUtils;
+import com.jeesharp.shiro.Principal;
+import com.jeesharp.shiro.constant.ShiroConstant;
+import org.apache.shiro.authc.*;
+import org.apache.shiro.web.util.WebUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+
+@Service
+public class SysApiAuthenticationFilter extends org.apache.shiro.web.filter.authc.FormAuthenticationFilter {
+
+    public static final String DEFAULT_CAPTCHA_PARAM = "validateCode";
+    public static final String DEFAULT_MOBILE_PARAM = "mobileLogin";
+    public static final String DEFAULT_MESSAGE_PARAM = "message";
+
+    private String captchaParam = DEFAULT_CAPTCHA_PARAM;
+    private String mobileLoginParam = DEFAULT_MOBILE_PARAM;
+    private String messageParam = DEFAULT_MESSAGE_PARAM;
+
+    private static final Logger log = LoggerFactory.getLogger(SysApiAuthenticationFilter.class);
+
+    /**
+     * 对跨域提供支持
+     */
+    @Override
+    protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
+        httpServletResponse.setHeader("Access-control-Allow-Origin", httpServletRequest.getHeader("Origin"));
+        httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS,PUT,DELETE");
+        httpServletResponse.setHeader("Access-Control-Allow-Headers", httpServletRequest.getHeader("Access-Control-Request-Headers"));
+        // 跨域时会首先发送一个option请求,这里我们给option请求直接返回正常状态
+        if (httpServletRequest.getMethod().equals(RequestMethod.OPTIONS.name())) {
+            httpServletResponse.setStatus(HttpStatus.OK.value());
+            return false;
+        }
+        return super.preHandle(request, response);
+    }
+
+    @Override
+    protected AuthenticationToken createToken(ServletRequest request, ServletResponse response) {
+        String pa = request.getParameter("password");
+        String username = getUsername(request);
+        String password = getPassword(request);
+        if (password == null) {
+            password = "";
+        }
+        boolean rememberMe = isRememberMe(request);
+        String host = StringUtils.getRemoteAddr((HttpServletRequest) request);
+        String captcha = getCaptcha(request);
+        boolean mobile = isMobileLogin(request);
+        return new com.jeesharp.modules.sys.security.UsernamePasswordToken(username, password.toCharArray(), rememberMe, host,captcha ,mobile);
+    }
+
+    public String getCaptchaParam() {
+        return captchaParam;
+    }
+
+    protected String getCaptcha(ServletRequest request) {
+        return WebUtils.getCleanParam(request, getCaptchaParam());
+    }
+
+    public String getMobileLoginParam() {
+        return mobileLoginParam;
+    }
+
+    protected boolean isMobileLogin(ServletRequest request) {
+        return WebUtils.isTrue(request, getMobileLoginParam());
+    }
+
+    public String getMessageParam() {
+        return messageParam;
+    }
+
+
+    @Override
+    public void setLoginUrl(String loginUrl) {
+        super.setLoginUrl("/apiSys/login");
+    }
+
+
+    /**
+     * 重写登录地址
+     */
+    @Override
+    protected void redirectToLogin(ServletRequest request, ServletResponse response) throws IOException {
+        HttpServletRequest req = (HttpServletRequest) request;
+        if (MobileUtils.checkAgentIsMobile(req.getHeader("user-agent"))) {
+            write((HttpServletResponse) response, ServerResponse.createByErrorCodeMessage(ResponseCode.NEED_LOGIN.getCode(),
+                    ResponseCode.NEED_LOGIN.getName()));
+        } else {
+            WebUtils.issueRedirect(request, response, "/api/sys/login");
+        }
+
+    }
+
+    /**
+     * 登录失败调用事件
+     */
+    @Override
+    protected boolean onLoginFailure(AuthenticationToken token,
+                                     AuthenticationException e, ServletRequest request, ServletResponse response) {
+        String className = e.getClass().getName(), message = "";
+        if (IncorrectCredentialsException.class.getName().equals(className)
+                || UnknownAccountException.class.getName().equals(className)) {
+            message = "用户或密码错误, 请重试.";
+        } else if (e.getMessage() != null && StringUtils.startsWith(e.getMessage(), "msg:")) {
+            message = StringUtils.replace(e.getMessage(), "msg:", "");
+        } else {
+            message = "系统出现点问题,请稍后再试!";
+            e.printStackTrace(); // 输出到控制台
+        }
+        write((HttpServletResponse) response, ServerResponse.createByErrorMessge(message));
+        request.setAttribute(getFailureKeyAttribute(), className);
+        request.setAttribute(getMessageParam(), message);
+        return false;
+    }
+
+
+    @Override
+    protected void issueSuccessRedirect(ServletRequest request,
+                                        ServletResponse response) throws Exception {
+        Principal principal = UserUtils.getPrincipal();
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("token", principal.getSessionid());
+        jsonObject.put("user", UserUtils.getUser());
+       // jsonObject.put("company",UserUtils.getCompany());
+        write((HttpServletResponse) response, ServerResponse.createBySuccess(jsonObject));
+    }
+
+
+    @Override
+    protected boolean onAccessDenied(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
+        if (this.isLoginRequest(request, response)) {
+            if (this.isLoginSubmission(request, response)) {
+                if (log.isTraceEnabled()) {
+                    log.trace("Login submission detected.  Attempting to execute login.");
+                }
+
+                return this.executeLogin(request, response);
+            } else {
+                if (log.isTraceEnabled()) {
+                    log.trace("Login page view.");
+                }
+
+                return true;
+            }
+        } else {
+            if (log.isTraceEnabled()) {
+                log.trace("Attempting to access a path which requires authentication.  Forwarding to the Authentication url [" + this.getLoginUrl() + "]");
+            }
+            if (((HttpServletRequest)request).getRequestURI().startsWith(ShiroConstant.REQUEST_API_SYS_URL)) {
+                write((HttpServletResponse) response,ServerResponse.createByErrorCodeMessage(ResponseCode.NEED_LOGIN.getCode(),
+                        ResponseCode.NEED_LOGIN.getName()));
+            } else {
+                this.saveRequestAndRedirectToLogin(request, response);
+            }
+            return false;
+        }
+    }
+
+
+    public static void write(HttpServletResponse response,String content) {
+        response.reset();
+        response.setContentType("application/json");
+        response.setHeader("Cache-Control", "no-store");
+        response.setCharacterEncoding("UTF-8");
+        try {
+            PrintWriter pw=response.getWriter();
+            pw.write(content);
+            pw.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void write(HttpServletResponse response,Object object) {
+        response.reset();
+        response.setContentType("application/json");
+        response.setHeader("Cache-Control", "no-store");
+        response.setCharacterEncoding("UTF-8");
+        try {
+            PrintWriter pw=response.getWriter();
+            pw.write(JsonMapper.toJsonString(object));
+            pw.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 26 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/user/UserSysController.java

@@ -0,0 +1,26 @@
+package com.jeesharp.modules.api.sys.user;
+
+import com.jeesharp.common.json.AjaxResult;
+import com.jeesharp.core.web.BaseController;
+import com.jeesharp.modules.sys.utils.UserUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author qiyuan
+ */
+@Api(tags = {"后台用户接口"})
+@RestController
+@RequestMapping("/apiSys/user")
+public class UserSysController extends BaseController {
+
+    @ApiOperation("店员信息")
+    @GetMapping
+    public AjaxResult info(){
+        return AjaxResult.okData(UserUtils.getUser());
+    }
+
+}

+ 29 - 0
jeesharp-module/api-gateway/src/main/java/com/jeesharp/modules/api/sys/util/MobileUtils.java

@@ -0,0 +1,29 @@
+package com.jeesharp.modules.api.sys.util;
+
+
+/**
+ * Created by 刘高峰 on 2018/6/21.
+ */
+public class MobileUtils {
+    private final static String[] agent = { "Android", "iPhone", "iPod","iPad", "Windows Phone", "MQQBrowser" }; //定义移动端请求的所有可能类型
+    /**
+     * 判断User-Agent 是不是来自于手机
+     * @param ua
+     * @return
+     */
+    public static boolean checkAgentIsMobile(String ua) {
+        boolean flag = false;
+        if (!ua.contains("Windows NT") || (ua.contains("Windows NT") && ua.contains("compatible; MSIE 9.0;"))) {
+// 排除 苹果桌面系统
+            if (!ua.contains("Windows NT") && !ua.contains("Macintosh")) {
+                for (String item : agent) {
+                    if (ua.contains(item)) {
+                        flag = true;
+                        break;
+                    }
+                }
+            }
+        }
+        return flag;
+    }
+}

+ 10 - 0
jeesharp-module/api-gateway/src/main/resources/application-api.yml

@@ -0,0 +1,10 @@
+# JWT配置
+jwt:
+  # 密匙KEY
+  secret: cuAihCz53DZRjZwbsGcZJ2Ai6At+T142uphtJMsk7iQ=
+  # Token前缀字符
+  tokenPrefix: Sans-
+  # 过期时间 单位秒 1天后过期=86400 7天后过期=604800
+  expiration: 2592000000
+  # 配置不需要认证的接口
+  antMatchers: /login/**,/favicon.ico

+ 1 - 0
jeesharp-module/api-gateway/src/main/resources/templates/modules/api/index.html

@@ -0,0 +1 @@
+<% layout("include_dialog.html"){ %><#select path="grantType" items="${fn.getDictList('grant_type')}" itemLabel="label" itemValue="value" class=""/> <% } %>

+ 1 - 0
jeesharp-module/jeesharp-front/READ.ME

@@ -0,0 +1 @@
+#接口

+ 33 - 0
jeesharp-module/jeesharp-front/pom.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>jeesharp-module</artifactId>
+        <groupId>org.jeesharp.module</groupId>
+        <version>2.0.1.RELEASE</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jeesharp-front</artifactId>
+    <packaging>jar</packaging>
+    <version>2.0.1.RELEASE</version>
+    <name>jeesharp-front</name>
+    <url>http://www.example.com</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+    <dependencies>
+
+        <dependency>
+            <groupId>org.jeesharp.platform</groupId>
+            <artifactId>jeesharp-admin</artifactId>
+            <version>${jeesharp.platform.version}</version>
+        </dependency>
+
+    </dependencies>
+
+</project>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
jeesharp-module/jeesharp-front/src/main/resources/front/css/app.7971f7ce.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
jeesharp-module/jeesharp-front/src/main/resources/front/css/chunk-vendors.ceb99a7e.css


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/favicon.ico


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/fonts/element-icons.535877f5.woff


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/fonts/element-icons.732389de.ttf


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/1.c77db050.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/10_23.801ad90b.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/11_24.b8f25609.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/12_25.320bde46.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/1_03.0c08158d.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/2.238059e6.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/2_03.390026ff.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/3.3127c627.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/3_05.c6f074fd.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/4.e7431058.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/4_09.6e56a21b.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/5.a975ba56.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/5_11.52999972.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/6_13.d6b7ed21.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/7_17.73308f2f.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/8_18.8bf27f74.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/9_19.db3e3b1e.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/Illustration1.a18f68ca.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/Illustration2.51a615f6.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/Illustration3.29f18f5d.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/aly.8a32f5ca.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/banner.7d0a926e.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/buzny.ef2fb5b2.jpg


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/chanpinbanner.53b8640d.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/gjdw.3dc50c16.jpg


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/goodle.27b2be0b.jpg


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/hr.a83ce417.jpg


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/hw.f1222bf8.jpg


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_1.00f1f4cc.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_1.7dca9d89.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_1.d06cb3a3.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_1.dce4c00f.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_10.454bbe18.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_10.55661ac1.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_11.5fd895d9.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_12.f2314353.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_13.6c347332.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_14.e07c7599.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_15.4e79c4cb.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_16.a37d1197.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_17.40ff0c83.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_2.02600a93.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_2.4698ac0b.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_2.f18d7d37.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_20.054c473a.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_22.66c721e8.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_24.42d2a526.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_25.4243f9c4.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_26.1b259366.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_3.60476f75.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_3.91cb2abd.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_3.f621a3e4.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_4.3df16dac.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_4.bb66f00b.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_4.d3a65a12.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_5.32f917b4.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_5.35a12977.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_5.439b1190.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_6.5e9c8762.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_6.746bf200.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_7.104deece.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_7.5e817d1c.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_8.860ef222.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_9.498f23a8.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icon_9.880b2cd6.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/icona.dd08fad3.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/iconb.7461bc2e.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/iconf.48222a56.png


BIN
jeesharp-module/jeesharp-front/src/main/resources/front/img/logo.f84d58a7.png


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است