zouxuan 5 years ago
parent
commit
1cf717f6fd

+ 3 - 0
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/SmsCodeController.java

@@ -2,6 +2,7 @@ package com.ym.mec.auth.web.controller;
 
 import com.google.code.kaptcha.Constants;
 import com.google.code.kaptcha.Producer;
+import com.google.code.kaptcha.servlet.KaptchaServlet;
 import com.ym.mec.auth.config.constant.SecurityConstants;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.validcode.SmsCodeService;
@@ -97,6 +98,8 @@ public class SmsCodeController extends BaseController {
         redisTemplate.opsForValue().set(Constants.KAPTCHA_SESSION_KEY + phone,capText,3, TimeUnit.MINUTES);
         // create the image with the text
         BufferedImage bi = captchaProducer.createImage(capText);
+        KaptchaServlet kaptchaServlet = new KaptchaServlet();
+        kaptchaServlet.init();
         ServletOutputStream out = response.getOutputStream();
         // write the data out
         ImageIO.write(bi, "jpg", out);

+ 5 - 10
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java

@@ -74,23 +74,18 @@ public class UserController extends BaseController {
 	@ApiOperation(value = "设置密码")
 	@PostMapping(value = "/setPassword",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
 	@ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
-			@ApiImplicitParam(name = "authCode", value = "验证码", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "password", value = "密码", required = true, dataType = "String") })
-	public Object setPassword(String mobile,String authCode,String password) {
-		if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(authCode) || StringUtils.isEmpty(password)){
+	public Object setPassword(String mobile,String password) {
+		if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(password)){
 			return failed();
 		}
 		SysUser sysUser = sysUserService.queryByPhone(mobile);
 		if(sysUser == null){
 			return failed("用户不存在");
 		}
-		if(smsCodeService.verifyValidCode(mobile, authCode)){
-			password = new BCryptPasswordEncoder().encode(password);
-			sysUserService.updatePassword(mobile,password);
-			return succeed();
-		}else {
-			return failed("验证码错误");
-		}
+		password = new BCryptPasswordEncoder().encode(password);
+		sysUserService.updatePassword(mobile,password);
+		return succeed();
 	}
 
 	@ApiOperation(value = "修改密码")

+ 13 - 3
mec-biz/src/main/resources/config/mybatis/CooperationOrganMapper.xml

@@ -76,14 +76,24 @@
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="CooperationOrgan"
             parameterType="map">
-        SELECT * FROM cooperation_organ ORDER BY id_
+        SELECT * FROM cooperation_organ
+        <where>
+            <if test="search != null">
+                organ_id_ = #{search}
+            </if>
+        </where>
+        ORDER BY id_
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM
-		cooperation_organ
+		SELECT COUNT(*) FROM cooperation_organ
+        <where>
+            <if test="search != null">
+                organ_id_ = #{search}
+            </if>
+        </where>
 	</select>
     <select id="queryByOrganId" resultMap="CooperationOrgan">
         SELECT * FROM cooperation_organ WHERE organ_id_ = #{organId}

+ 2 - 1
mec-client-api/src/main/java/com/ym/im/ImFeignService.java

@@ -2,6 +2,7 @@ package com.ym.im;
 
 import com.ym.im.fallback.ImFeignServiceFallback;
 import com.ym.mec.common.config.FeignConfiguration;
+import com.ym.mec.common.entity.ImUserModel;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -10,5 +11,5 @@ import org.springframework.web.bind.annotation.RequestBody;
 public interface ImFeignService {
 
     @PostMapping(value = "user/register")
-    Object getUser(@RequestBody String username);
+    Object getUser(@RequestBody ImUserModel userModel);
 }

+ 2 - 0
mec-web/src/main/java/com/ym/mec/web/controller/CooperationOrganController.java

@@ -1,5 +1,7 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.common.security.AuthUser;
+import com.ym.mec.common.security.SecurityUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;