2 Commits ea19d6b1b8 ... 8eb48919c4

Autore SHA1 Messaggio Data
  半月无霜 8eb48919c4 Merge branch 'master' of http://192.168.20.122:3000/root/qiyewechatApp 4 anni fa
  半月无霜 992ec9c98f 医生注册BUG修改 4 anni fa

+ 4 - 2
ymall/src/main/java/com/liangjian11/ymall/controller/DoctorController.java

@@ -178,9 +178,11 @@ public class DoctorController {
 
 		if(doctorService.judgeOpenidIsExist(openid)){
 			UserAccount user = userAccountService.selectOneByOpenid(openid);
-			doctor.setPhone(user.getMobile());
+			String mobile = user.getMobile();
+			if(StringUtils.isBlank(mobile))
+				return ResultUtil.createFail("手机号不能为空");
+			doctor.setPhone(mobile);
 			doctor.setCheckStatus(1);
-
 			return doctorService.update(doctor);
 		}
 		return doctorService.create(doctor, openid);

+ 63 - 67
ymall/src/main/java/com/liangjian11/ymall/controller/common/WechatController.java

@@ -21,6 +21,7 @@ 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 javax.annotation.Resource;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
@@ -34,31 +35,31 @@ import java.util.UUID;
 @RestController
 @RequestMapping("/ymallWechat")
 public class WechatController {
-
+	
 	private Logger logger = LoggerFactory.getLogger(WechatController.class);
-
+	
 	private String netLoginVideoAccess = "specialist,shortVideo,oneVideoPlayer";
-
+	
 	@Autowired
 	private UserAccountService userAccountService;
 	@Autowired
 	private UserRoleService userRoleService;
-
+	
 	@Resource
 	private JwtConfig jwtConfig;
-
+	
 	@Resource
 	private WxMpHandle wxMpHandle;
-
+	
 	@Value("${ymall.appid}")
 	private String appid;
-
+	
 	@Value("${ymall.secret}")
 	private String secret;
-
+	
 	@Resource
 	private RedirectPathSource redirectPathSource;
-
+	
 	@GetMapping("/authInfo")
 	public void authInfo(@RequestParam(required = false, defaultValue = "") String redirectPath,
 						 HttpServletRequest request, HttpServletResponse response) throws IOException {
@@ -75,7 +76,7 @@ public class WechatController {
 		}
 		response.sendRedirect(redirectPath);
 	}
-
+	
 	/**
 	 * 网页授权后跳转
 	 *
@@ -90,7 +91,7 @@ public class WechatController {
 						@RequestParam(name = "code", defaultValue = "", required = false) String code,
 						@RequestParam(name = "id", defaultValue = "", required = false) String id,// ID参数占位
 						@RequestParam(name = "redirectCode", defaultValue = "", required = false) String redirectCode,
-						@RequestParam(name = "identity", defaultValue = "0",required = false) Integer identity,
+						@RequestParam(name = "identity", defaultValue = "0", required = false) Integer identity,
 						HttpServletRequest request, HttpServletResponse response) throws IOException {
 		String fillInfoPath = redirectPathSource.getFillInfo();
 		if (StringUtils.isBlank(code)) {
@@ -105,7 +106,7 @@ public class WechatController {
 		String openid = (String) jsonObj.get("openid");
 		String token = createToken(openid);
 		logger.info("token: " + token);
-
+		
 		Cookie cookie = new Cookie("token", token);
 		cookie.setPath("/");
 		cookie.setMaxAge(24 * 60 * 60);
@@ -114,28 +115,28 @@ public class WechatController {
 		redirectCodeCoookie.setPath("/");
 		redirectCodeCoookie.setMaxAge(3600);
 		response.addCookie(redirectCodeCoookie);
-
-    JSONObject userInfoJson = WechatHandle.getUserInfo(openid, appid, secret, code);
-    UserAccount userAccount = userAccountService.checkAccountByUnionid(userInfoJson);
-    Document document = MongoDBUtil.queryVLoginToken(userAccount.getId());
-    Calendar calendar = Calendar.getInstance();
-    calendar.add(Calendar.DAY_OF_YEAR,30);
-    String loginToken = UUID.randomUUID().toString();
-    if( Objects.isNull(document)){
-      MongoDBUtil.insertVLoginToken(calendar.getTime(),userAccount.getId(),loginToken,1);
-    }else{
-      MongoDBUtil.updateVLoginTOken(calendar.getTime(),userAccount.getId(),loginToken);
-    }
-    Cookie cookie0 = new Cookie("loginTokenAccount", userAccount.getId());
-    cookie0.setPath("/");
-    cookie0.setMaxAge(24 * 60 * 60);
-    cookie0.setDomain("360lj.com");
-    response.addCookie(cookie0);
-    Cookie cookie1 = new Cookie("LoginToken", loginToken);
-    cookie1.setPath("/");
-    cookie1.setMaxAge(24 * 60 * 60);
-    cookie1.setDomain("360lj.com");
-    response.addCookie(cookie1);
+		
+		JSONObject userInfoJson = WechatHandle.getUserInfo(openid, appid, secret, code);
+		UserAccount userAccount = userAccountService.checkAccountByUnionid(userInfoJson);
+		Document document = MongoDBUtil.queryVLoginToken(userAccount.getId());
+		Calendar calendar = Calendar.getInstance();
+		calendar.add(Calendar.DAY_OF_YEAR, 30);
+		String loginToken = UUID.randomUUID().toString();
+		if (Objects.isNull(document)) {
+			MongoDBUtil.insertVLoginToken(calendar.getTime(), userAccount.getId(), loginToken, 1);
+		} else {
+			MongoDBUtil.updateVLoginTOken(calendar.getTime(), userAccount.getId(), loginToken);
+		}
+		Cookie cookie0 = new Cookie("loginTokenAccount", userAccount.getId());
+		cookie0.setPath("/");
+		cookie0.setMaxAge(24 * 60 * 60);
+		cookie0.setDomain("360lj.com");
+		response.addCookie(cookie0);
+		Cookie cookie1 = new Cookie("LoginToken", loginToken);
+		cookie1.setPath("/");
+		cookie1.setMaxAge(24 * 60 * 60);
+		cookie1.setDomain("360lj.com");
+		response.addCookie(cookie1);
 //    if (netLoginVideoAccess.contains(redirectCode)) {
 //      if (identity.equals(0)) {  //用户授权
 //        if (StringUtils.isBlank(userAccount.getNickname())) {
@@ -150,34 +151,29 @@ public class WechatController {
 //      response.sendRedirect(url);
 //      return;
 //    }
-
-    if (identity.equals(0)) {  //用户授权
-      if (StringUtils.isNotBlank(userAccount.getNickname())) {
-        response.sendRedirect(redirectPathSource.getRedirectPath(redirectCode, userAccount, id));
-        return;
-      }
-      response.sendRedirect(redirectPathSource.getRedirectPath(redirectCode, null, ""));
-      return;
-    } else if(identity.equals(1) || identity.equals(2)){ //医生合伙人授权
-      userRoleService.checkRole(identity, userAccount, id, redirectCode, response);
-      return;
-    }
-
-		// 判断是否有该用户,如果有跳转个人中心,没有则跳转注册页面
-		if (userAccount == null) {
-			JSONObject userInfo = WechatHandle.getUserInfo(openid, appid, secret, code);
-			userAccountService.create(userInfo);
-			logger.info("将跳转至: " + fillInfoPath);
-			String html = "<script type='text/javascript'>location.href='" + fillInfoPath + "';</script>";
-			response.getWriter().print(html);
-			return;
-		}
-		if (StringUtils.isBlank(userAccount.getMobile())) {
-			logger.info("将跳转至: " + fillInfoPath);
-			String html = "<script type='text/javascript'>location.href='" + fillInfoPath + "';</script>";
-			response.getWriter().print(html);
+		
+		if (identity.equals(0)) {  //用户授权
+			// 判断是否有该用户,如果有跳转个人中心,没有则跳转注册页面
+			if (userAccount == null) {
+				JSONObject userInfo = WechatHandle.getUserInfo(openid, appid, secret, code);
+				userAccountService.create(userInfo);
+				logger.info("将跳转至: " + fillInfoPath);
+				String html = "<script type='text/javascript'>location.href='" + fillInfoPath + "';</script>";
+				response.getWriter().print(html);
+				return;
+			}
+			if (StringUtils.isBlank(userAccount.getMobile())) {
+				logger.info("将跳转至: " + fillInfoPath);
+				String html = "<script type='text/javascript'>location.href='" + fillInfoPath + "';</script>";
+				response.getWriter().print(html);
+				return;
+			}
+		} else if (identity.equals(1) || identity.equals(2)) { //医生合伙人授权
+			userRoleService.checkRole(identity, userAccount, id, redirectCode, response);
 			return;
 		}
+		
+		
 		String otherRedirectPath = redirectPathSource.getRedirectPath(redirectCode, userAccount, id);
 		logger.info("将跳转至: " + otherRedirectPath);
 		String html = "<script type='text/javascript'>" +
@@ -185,7 +181,7 @@ public class WechatController {
 				"</script>";
 		response.getWriter().print(html);
 	}
-
+	
 	@GetMapping("/skip")
 	public void skipPath(@RequestParam(name = "redirectPath", required = false) String redirectPath,
 						 @RequestParam(name = "redirectCode", defaultValue = "", required = false) String redirectCode,
@@ -196,17 +192,17 @@ public class WechatController {
 		String token = request.getHeader(jwtConfig.getHeader());
 		token = token != null ? token : request.getParameter(jwtConfig.getHeader());
 		openid = StringUtils.isNotBlank(openid) ? openid : jwtConfig.getUsernameFromToken(token);
-
+		
 		UserAccount user = userAccountService.selectOneByOpenid(openid);
 		if (id != null && id.equals("null"))
 			id = "";
-
+		
 		redirectPath = redirectPath != null ? redirectPath : redirectPathSource.getRedirectPath(redirectCode, user, id);
 		logger.info("将跳转至: " + redirectPath);
 		response.sendRedirect(redirectPath);
 		return;
 	}
-
+	
 	/**
 	 * JS网页授权获取,jsapi_ticket以及签名
 	 *
@@ -216,8 +212,8 @@ public class WechatController {
 	public JSONObject getSignature(@RequestParam("url") String url) {
 		return wxMpHandle.getSignature(url, appid);
 	}
-
-
+	
+	
 	public String createToken(String openid) throws RuntimeException {
 		if (StringUtils.isBlank(openid)) {
 			throw new RuntimeException("微信授权openid不能为空");
@@ -225,5 +221,5 @@ public class WechatController {
 		String token = jwtConfig.createToken(openid);
 		return token;
 	}
-
+	
 }

+ 1 - 1
ymall/src/main/java/com/liangjian11/ymall/service/impl/DoctorServiceImpl.java

@@ -494,7 +494,7 @@ public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> impleme
     jsonObj.put("videoLineationPrice", new BigDecimal("0"));
     jsonObj.put("videoPrice", new BigDecimal("0"));
     String joinWorkdayTime = StringUtils.isBlank(doctor.getJoinWorkdayTime())
-            ? "1970-01-01"
+            ? "1970-01-02"
             : doctor.getJoinWorkdayTime() + "-01";
     jsonObj.put("joinWorkdayTime", joinWorkdayTime);
 

+ 17 - 17
ymall/src/main/resources/application-pgdev.properties

@@ -27,10 +27,10 @@ spring.application.name = ymz1
 resource.Locations= D:\\public\\
 resource.href= /public/
 #project.weburl= http://192.168.10.91:8070
-project.weburl= https://mem.360lj.com/ymz1
+project.weburl= https://mem.360lj.com/ym1
 
 # \u5916\u7F51\u8BBF\u95EE\u57DF\u540D
-domain.ymall= https://mem.360lj.com/ymz1
+domain.ymall= https://mem.360lj.com/ym1
 # mp\u8BBF\u95EE\u57DF\u540D
 domain.mp= https://mem.360lj.com/mp2
 # \u4E91\u5065\u5EB7\u7F51\u5173
@@ -39,23 +39,23 @@ domain.mpcpzuul= http://192.168.50.32:13001
 # \u91CD\u5B9A\u5411\u8DEF\u5F84
 ymall.appid= wx4f8c9fef3896ad71
 ymall.secret= ea186d9f2941b5cd88004e339a4ec479
-ymall.path.fillInfo= https://mem.360lj.com/uip/#/doctorRegister
-ymall.path.doctorFlow= https://mem.360lj.com/uip/#/doctorFlow
-ymall.path.personalInfo= https://mem.360lj.com/uip/#/doctorMine
+ymall.path.fillInfo= https://mem.360lj.com/ui/#/doctorRegister
+ymall.path.doctorFlow= https://mem.360lj.com/ui/#/doctorFlow
+ymall.path.personalInfo= https://mem.360lj.com/ui/#/doctorMine
 ymall.path.queryExpress= https://m.360lj.com/nhome/express
-ymall.path.guideFlow= https://mem.360lj.com/uip/#/h5Flow
-ymall.path.activityhelpPage= https://mem.360lj.com/uip/#/friendsHelp
-ymall.path.activityIndex= https://mem.360lj.com/uip/#/myHelp
-ymall.path.selectRoles= https://mem.360lj.com/uip/#/selectRoles
-ymall.path.signUp= https://mem.360lj.com/uip/#/SignUp
-ymall.path.doctorDeactivation= https://mem.360lj.com/uip/#/doctorMine
-ymall.path.doctorToBeCertified= https://mem.360lj.com/uip/#/doctorFlow
+ymall.path.guideFlow= https://mem.360lj.com/ui/#/h5Flow
+ymall.path.activityhelpPage= https://mem.360lj.com/ui/#/friendsHelp
+ymall.path.activityIndex= https://mem.360lj.com/ui/#/myHelp
+ymall.path.selectRoles= https://mem.360lj.com/ui/#/selectRoles
+ymall.path.signUp= https://mem.360lj.com/ui/#/SignUp
+ymall.path.doctorDeactivation= https://mem.360lj.com/ui/#/doctorMine
+ymall.path.doctorToBeCertified= https://mem.360lj.com/ui/#/doctorFlow
 ymall.path.doctorHome= https://mem.360lj.com/ui2/#/DoctorHome
-ymall.path.partnerDeactivation= https://mem.360lj.com/uip/#/PartnerDeactivation
-ymall.path.partnerToBeCertified= https://mem.360lj.com/uip/#/PartnerToBeCertified
-ymall.path.partnerHome= https://mem.360lj.com/uip/#/PartnerHome
-ymall.path.noFollow= https://mem.360lj.com/uip/#/NoFollow
-ymall.path.myProfitIndex= https://mem.360lj.com/uip/#/MyProfitIndex
+ymall.path.partnerDeactivation= https://mem.360lj.com/ui/#/PartnerDeactivation
+ymall.path.partnerToBeCertified= https://mem.360lj.com/ui/#/PartnerToBeCertified
+ymall.path.partnerHome= https://mem.360lj.com/ui/#/PartnerHome
+ymall.path.noFollow= https://mem.360lj.com/ui/#/NoFollow
+ymall.path.myProfitIndex= https://mem.360lj.com/ui/#/MyProfitIndex
 ymall.path.frontHost= https://mem.360lj.com/ui2
 ymall.path.specialist= https://mem.360lj.com/ui2/#/specialist
 ymall.path.shortVideo=https://mem.360lj.com/ui2/#/shortVideo