1.限流处理 @RateLimiter
@PostMapping("/createOrder")
@ApiOperation("创建充值订单")
@RateLimiter(key = CacheConstants.REPEAT_SUBMIT_KEY,time = 10,count = 1,limitType = LimitType.IP)
public R createOrder(@RequestBody Form form) {//业务处理return R.ok(order.getOrderNo());
}
2.@RepeatSubmit 防止重复提交
@RepeatSubmit
@PostMapping("/createOrder")
@ApiOperation("创建充值订单")
public R createOrder(@RequestBody TCommissionOrderForm form) {//业务处理return R.ok(order.getOrderNo());
}
3.数据字典使用
(1)定义
export default {dicts: ['dai_li', 'sys_yes_no'],
(2)列表获取
<el-table-column label="审核状态" align="center" prop="status"><template v-slot:="scope"><dict-tag :options="dict.type.sys_yes_no" :value="scope.row.status"/></template>
</el-table-column>
(3)查询/新增/编辑
<el-form-item label="等级" prop="agentGrade"><el-select v-model="queryParams.agentGrade" placeholder="请选择代理等级" clearable><el-optionv-for="dict in dict.type.dai_li":key="dict.value":label="dict.label":value="dict.value"/></el-select>
</el-form-item>
(4)js内获取
typeFormat(agentGrade) {var that=this;this.dict.type.dai_li.forEach(function (i){if (i.value==agentGrade){that.form.agentGradeFy=i.label;}})
},
4.图片
limit限制上传图片数量
<el-form-item label="图片" prop="coverUrl"><image-upload :limit="1" v-model="form.coverUrl" :width="80" :height="80"/>
</el-form-item>
5.下拉框长度比输入框短的处理办法
style=“width: 100%”
<el-form-item label="管理者性别" prop="sex"><el-select v-model="form.sex" style="width: 100%" disabled placeholder="请选择管理者性别"><el-optionv-for="dict in dict.type.sys_user_sex":key="dict.value":label="dict.label":value="dict.value"></el-option></el-select>
</el-form-item>