mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
fix:用户id大值转换精度丢失的问题
* add:配置管理接口 * add:参数增删改查 * fix:用户id大值转换精度丢失的问题
This commit is contained in:
@@ -84,7 +84,7 @@ public class AdminController {
|
||||
@Operation(summary = "批量修改用户状态")
|
||||
@RequiresPermissions("sys:role:superAdmin")
|
||||
@Parameter(name = "status", description = "用户状态", required = true)
|
||||
public Result<Void> changeStatus(@PathVariable Integer status, @RequestBody Long[] userIds) {
|
||||
public Result<Void> changeStatus(@PathVariable Integer status, @RequestBody String[] userIds) {
|
||||
sysUserService.changeStatus(status, userIds);
|
||||
return new Result<Void>();
|
||||
}
|
||||
|
||||
@@ -64,5 +64,5 @@ public interface SysUserService extends BaseService<SysUserEntity> {
|
||||
* @param status 用户状态
|
||||
* @param userIds 用户ID数组
|
||||
*/
|
||||
void changeStatus(Integer status, Long[] userIds);
|
||||
void changeStatus(Integer status, String[] userIds);
|
||||
}
|
||||
|
||||
+3
-3
@@ -197,10 +197,10 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeStatus(Integer status, Long[] userIds) {
|
||||
for (Long userId : userIds) {
|
||||
public void changeStatus(Integer status, String[] userIds) {
|
||||
for (String userId : userIds) {
|
||||
SysUserEntity entity = new SysUserEntity();
|
||||
entity.setId(userId);
|
||||
entity.setId(Long.parseLong(userId));
|
||||
entity.setStatus(status);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const userIds = users.map(user => Number(user.userid));
|
||||
const userIds = users.map(user => user.userid);
|
||||
if (userIds.some(id => isNaN(id))) {
|
||||
this.$message.error('存在无效的用户ID');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user