huanghongfa
2021-05-19 14590de8e4fb23909f1767a53d1f92007f9bbcc4
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 登录结果
@@ -62,8 +62,29 @@
        LoginReturnVO loginReturnVO =loginService.loginAppletsBackStage(account,password);
        return R.ok(loginReturnVO);
    }
    /**
     * 大数据统计平台(区、街道、社区三层登陆接口)
     *
     * @param loginBody 账户
     * @return 登录结果
     * @author manailin
     * @date 2021-5-13 10:56
     */
    @PostMapping("/loginBigDataBackStage")
    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);
        return R.ok(loginReturnVO);
    }
    /**
     * 社区后台登录
     *
     * @param account 账户
     * @param password 密码
     * @return 登录结果
@@ -73,8 +94,10 @@
        LoginReturnVO loginReturnVO =loginService.loginCommunityBackage(account,password);
        return R.ok(loginReturnVO);
    }
    /**
     * 认证中心刷新token
     *
     * @param refreshToken 用户端保存的刷新token
     * @return 新的token 和刷新token
     */
@@ -109,6 +132,7 @@
    /**
     * 商家后台登录
     *
     * @param account 账户
     * @param password 密码
     * @return 登录结果