| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入一条新令牌") |
| | | @ApiOperation(value = "创建新令牌") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "令牌类别:0-临时,1-固定", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "min", value = "分钟数:默认1个月", dataType = "Integer", paramType = "query", example = "43200") |
| | |
| | | min = SettingData.TOKEN_EXPIRE; |
| | | } |
| | | |
| | | return success(null); |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | TokenEntity te = tokenService.getNewToken(type, min, ue, req); |
| | | int rows = tokenService.insertToken(te); |
| | | if (0 == rows) { |
| | | return fail("创建令牌失败", null); |
| | | } |
| | | |
| | | return success(te); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |