添加修改SN号数量功能
This commit is contained in:
@@ -66,6 +66,34 @@ class SNAdminController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
// 修改可管理的SN号数量
|
||||
async editSNCount() {
|
||||
const { ctx } = this;
|
||||
try {
|
||||
let rdmcode = await this.checkUid(ctx);
|
||||
if (!rdmcode) {
|
||||
this.setResponse(ctx, 401, 'token过期或错误', "none");
|
||||
return;
|
||||
}
|
||||
const uid = JSON.parse(rdmcode).uid;
|
||||
const body = ctx.request.body;
|
||||
const result = await ctx.service.sNAdmin.editSNCount(uid, body);
|
||||
if (result == "error") {
|
||||
this.setResponse(ctx, 500, '服务器错误', "none");
|
||||
return;
|
||||
}
|
||||
if (result) {
|
||||
this.setResponse(ctx, 200, '修改可管理的SN号数量成功', "none");
|
||||
} else {
|
||||
this.setResponse(ctx, 404, '修改可管理的SN号数量失败', "none");
|
||||
}
|
||||
} catch (error) {
|
||||
const blockName = fileName + "--" + "editSNCount";
|
||||
ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error);
|
||||
this.setResponse(ctx, 500, '服务器错误', "none");
|
||||
}
|
||||
}
|
||||
|
||||
// B端分配SN号
|
||||
async allocationSN() {
|
||||
const { ctx } = this;
|
||||
|
||||
Reference in New Issue
Block a user