| | |
| | | import com.ruoyi.admin.entity.Region; |
| | | import com.ruoyi.admin.service.RegionService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private RegionService regionService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 收货地址省市二级联动 |
| | | */ |
| | | @GetMapping("/addressTree") |
| | | @ApiOperation(value = "收货地址省市二级联动", tags = {"后台-首页"}) |
| | | @ApiOperation(value = "选择城市:省市二级联动", tags = {"后台-首页"}) |
| | | public R<List<Region>> addressTree() { |
| | | return R.ok(regionService.addressTree()); |
| | | // LoginUser loginUser = tokenService.getLoginUser(); |
| | | // if (null == loginUser) { |
| | | // return R.loginExpire("登录失效!"); |
| | | // } |
| | | // List<String> cityCodeList; |
| | | // if (loginUser.getIsFranchisee()) { |
| | | // cityCodeList = loginUser.getCityList(); |
| | | // } else { |
| | | // cityCodeList = new ArrayList<>(); |
| | | // } |
| | | return R.ok(regionService.addressTree(null)); |
| | | } |
| | | |
| | | } |