|
|
@@ -69,7 +69,13 @@ public class SupplyManageController {
|
|
|
*/
|
|
|
@PostMapping("/detail")
|
|
|
public Result<User> detail(@RequestBody Map<String, Object> params) {
|
|
|
- Long id = params.get("id") != null ? ((Number) params.get("id")).longValue() : null;
|
|
|
+ Object rawId = params.get("id");
|
|
|
+ Long id = null;
|
|
|
+ if (rawId instanceof Number) {
|
|
|
+ id = ((Number) rawId).longValue();
|
|
|
+ } else if (rawId instanceof String) {
|
|
|
+ try { id = Long.parseLong((String) rawId); } catch (NumberFormatException ignored) {}
|
|
|
+ }
|
|
|
if (id == null) {
|
|
|
return Result.error("id不能为空");
|
|
|
}
|
|
|
@@ -77,7 +83,7 @@ public class SupplyManageController {
|
|
|
if (user == null) {
|
|
|
return Result.error("供应商不存在");
|
|
|
}
|
|
|
- user.setPassword(null); // 清除密码
|
|
|
+ user.setPassword(null);
|
|
|
return Result.success(user);
|
|
|
}
|
|
|
|