| | |
| | | package com.panzhihua.auth.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | 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; |
| | | import com.panzhihua.common.model.vos.LoginReturnVO; |
| | | import com.panzhihua.common.model.vos.LoginReturnsVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.JWTTokenUtil; |
| | | import io.jsonwebtoken.Claims; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import io.jsonwebtoken.Claims; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | /** |
| | | * 小程序登录 |
| | | * |
| | | * @param openId 微信标识 |
| | | * @param openId |
| | | * 微信标识 |
| | | * @return jwt |
| | | */ |
| | | @PostMapping("/loginApplets") |
| | |
| | | /** |
| | | * 用户登出 |
| | | * |
| | | * @param token 登录用户token |
| | | * @param token |
| | | * 登录用户token |
| | | * @return 登出结果 |
| | | */ |
| | | @PostMapping("/logout") |
| | |
| | | /** |
| | | * 运营后台登录 |
| | | * |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @param account |
| | | * 账户 |
| | | * @param password |
| | | * 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginAppletsBackStage") |
| | |
| | | /** |
| | | * 大数据统计平台(区、街道、社区三层登陆接口) |
| | | * |
| | | * @param loginBody 账户 |
| | | * @param loginBody |
| | | * 账户 |
| | | * @return 登录结果 |
| | | * @author manailin |
| | | * @date 2021-5-13 10:56 |
| | |
| | | /** |
| | | * 社区后台登录 |
| | | * |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @param account |
| | | * 账户 |
| | | * @param password |
| | | * 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginCommunityBackage") |
| | |
| | | /** |
| | | * 认证中心刷新token |
| | | * |
| | | * @param refreshToken 用户端保存的刷新token |
| | | * @param refreshToken |
| | | * 用户端保存的刷新token |
| | | * @return 新的token 和刷新token |
| | | */ |
| | | @PostMapping("/refreshToken") |
| | |
| | | throw new TokenException("刷新token校验失败"); |
| | | } |
| | | String subject = claims.getSubject(); |
| | | Integer type = (Integer) claims.get("type"); |
| | | Integer type = (Integer)claims.get("type"); |
| | | boolean empty1 = ObjectUtils.isEmpty(subject); |
| | | boolean empty2 = ObjectUtils.isEmpty(type); |
| | | if (empty1 || empty2) { |
| | |
| | | /** |
| | | * 商家后台登录 |
| | | * |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @param account |
| | | * 账户 |
| | | * @param password |
| | | * 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginShopBackStage") |
| | |
| | | return R.ok(loginReturnVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 网格综治APP登录 |
| | | * |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @param account |
| | | * 账户 |
| | | * @param password |
| | | * 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginGridApp") |
| | |
| | | return R.ok(loginReturnVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 网格综治后台登录 |
| | | * |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @param account |
| | | * 账户 |
| | | * @param password |
| | | * 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginGridBackstage") |