|
|
@@ -129,6 +129,54 @@ public class IndexController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 普通用户端 (如云芯客)
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Operation(summary = "登录-微信普通用户端", description = "登录--微信普通用户端")
|
|
|
+ @RequestMapping(value = "wxUserLogin", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public ResultContent wxUserLogin(@RequestBody LoginParam param, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ if (param.getLoginFromType() == null) {
|
|
|
+ return ResultContent.buildFail("loginFromType 不能为空");
|
|
|
+ }
|
|
|
+ ResultContent result = indexService.login(param);
|
|
|
+ if (result.isSuccess()) {
|
|
|
+ LoginTokenModel tokenModel = (LoginTokenModel) result.getContent();
|
|
|
+ response.setHeader("accessToken", tokenModel.getAccess_token());
|
|
|
+ Cookie cookie = new Cookie("accessToken", tokenModel.getAccess_token());
|
|
|
+ cookie.setMaxAge(60 * 60 * 24 * 3);
|
|
|
+ cookie.setPath("/");
|
|
|
+ response.addCookie(cookie);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 微信商户端 (如云芯商)
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Operation(summary = "登录-微信商户端", description = "登录--微信商户端")
|
|
|
+ @RequestMapping(value = "wxBusLogin", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public ResultContent wxBusLogin(@RequestBody LoginParam param, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ if (param.getLoginFromType() == null) {
|
|
|
+ return ResultContent.buildFail("loginFromType 不能为空");
|
|
|
+ }
|
|
|
+ ResultContent result = indexService.login(param);
|
|
|
+ if (result.isSuccess()) {
|
|
|
+ LoginTokenModel tokenModel = (LoginTokenModel) result.getContent();
|
|
|
+ response.setHeader("accessToken", tokenModel.getAccess_token());
|
|
|
+ Cookie cookie = new Cookie("accessToken", tokenModel.getAccess_token());
|
|
|
+ cookie.setMaxAge(60 * 60 * 24 * 3);
|
|
|
+ cookie.setPath("/");
|
|
|
+ response.addCookie(cookie);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@Operation(summary = "登录某个机构 + 用户名密码登录", description = "登录某个机构 + 用户名密码登录")
|
|
|
@RequestMapping(value = "loginToOid", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public ResultContent loginToOid(@RequestBody LoginParam param, HttpServletRequest request, HttpServletResponse response) {
|