|
|
@@ -2,7 +2,6 @@ package com.zhongshu.card.server.core.controller.user;
|
|
|
|
|
|
import com.github.microservice.auth.client.model.LoginTokenModel;
|
|
|
import com.github.microservice.auth.client.model.UserTokenModel;
|
|
|
-import com.github.microservice.auth.security.helper.AuthHelper;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.net.ResultState;
|
|
|
import com.zhongshu.card.client.model.base.ReTokenParam;
|
|
|
@@ -10,8 +9,6 @@ import com.zhongshu.card.client.model.login.LoginCommonModel;
|
|
|
import com.zhongshu.card.client.model.org.GetPhoneModel;
|
|
|
import com.zhongshu.card.client.model.org.LoginParam;
|
|
|
import com.zhongshu.card.client.model.org.LoginPlatformTokenModel;
|
|
|
-import com.zhongshu.card.client.service.org.OrganizationService;
|
|
|
-import com.zhongshu.card.client.service.org.UserAccountService;
|
|
|
import com.zhongshu.card.client.type.LoginFromType;
|
|
|
import com.zhongshu.card.server.core.service.org.IndexService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
@@ -39,16 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class IndexController {
|
|
|
|
|
|
@Autowired
|
|
|
- IndexService indexService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- OrganizationService organizationService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- AuthHelper authHelper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- UserAccountService userAccountService;
|
|
|
+ private IndexService indexService;
|
|
|
|
|
|
@Operation(summary = "物联网管理登录", description = "物联网管理登录")
|
|
|
@RequestMapping(value = "iotLogin", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
|
@@ -138,19 +126,8 @@ public class IndexController {
|
|
|
@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.setLoginFromType(LoginFromType.Student);
|
|
|
+ return indexService.wxUserLogin(param);
|
|
|
}
|
|
|
|
|
|
/**
|