根据token 获取店铺信息

This commit is contained in:
韩鹏辉 2024-06-26 16:49:22 +08:00
parent b96c4dcef2
commit d8305159bd
2 changed files with 18 additions and 0 deletions

View File

@ -43,4 +43,11 @@ public class LoginContoller {
}
@RequestMapping(value = "getShopInfo")
public Result getShopInfo(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType){
return loginService.getShopInfo(token);
}
}

View File

@ -176,4 +176,15 @@ public class LoginService {
return Result.success(SUCCESS);
}
public Result getShopInfo(String token){
JSONObject jsonObject= TokenUtil.parseParamFromToken(token);
if(Objects.isNull(jsonObject)){
return Result.fail(CodeEnum.TOKENTERROR);
}
TbShopInfo shopInfo= tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(jsonObject.getString("shopId")));
return Result.success(SUCCESS,shopInfo);
}
}