manailin
2021-05-17 85ca353d0396003176946a0ee37b4b5a7329de7a
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/api/LoginApi.java
@@ -1,5 +1,6 @@
package com.panzhihua.auth.api;
import com.panzhihua.auth.model.dos.LoginBody;
import com.panzhihua.auth.service.LoginService;
import com.panzhihua.common.exceptions.TokenException;
import com.panzhihua.common.exceptions.UnAuthenticationException;
@@ -9,10 +10,7 @@
import com.panzhihua.common.utlis.JWTTokenUtil;
import io.jsonwebtoken.Claims;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -51,8 +49,10 @@
        loginService.logoutApplets(token);
        return R.ok();
    }
    /**
     * 运营后台登录
     *
     * @param account 账户
     * @param password 密码
     * @return 登录结果
@@ -65,17 +65,17 @@
    /**
     * 大数据统计平台(区、街道、社区三层登陆接口)
     * @param account 账户
     * @param password 密码
     * @author manailin
     *
     * @param loginBody 账户
     * @return 登录结果
     * @author manailin
     * @date 2021-5-13 10:56
     */
    @PostMapping("/loginBigDataBackStage")
    public R loginBigDataBackStage(@RequestParam("account") String account, @RequestParam("password")String password){
        boolean accountCheck = ObjectUtils.isEmpty(account);
        boolean passwordCheck = ObjectUtils.isEmpty(password);
        if (accountCheck||passwordCheck) {
    public R loginBigDataBackStage(@RequestBody LoginBody loginBody) {
        String account = loginBody.getAccount();
        String password = loginBody.getPassword();
        if (ObjectUtils.isEmpty(account) || ObjectUtils.isEmpty(password)) {
            return R.fail("账户密码不能为空");
        }
        LoginReturnVO loginReturnVO =loginService.loginBigDataBackStage(account,password);
@@ -84,6 +84,7 @@
    /**
     * 社区后台登录
     *
     * @param account 账户
     * @param password 密码
     * @return 登录结果
@@ -93,8 +94,10 @@
        LoginReturnVO loginReturnVO =loginService.loginCommunityBackage(account,password);
        return R.ok(loginReturnVO);
    }
    /**
     * 认证中心刷新token
     *
     * @param refreshToken 用户端保存的刷新token
     * @return 新的token 和刷新token
     */
@@ -129,6 +132,7 @@
    /**
     * 商家后台登录
     *
     * @param account 账户
     * @param password 密码
     * @return 登录结果