Skip to content

Commit

Permalink
Update user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Waikkii authored Sep 12, 2021
1 parent 68730be commit 0f9e4c8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions backend/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,25 +254,25 @@ module.exports = class User {

async updateRemark() {
if (!this.eid || !this.remark || this.remark.replace(/(^\s*)|(\s*$)/g, '') === '') {
throw new UserError('参数错误', 240, 200);
throw new UserError('eid参数错误', 240, 200);
}

const envs = await getEnvs();
const env = await envs.find((item) => item._id === this.eid);
if (!env) {
throw new UserError('没有找到这个账户,重新登录试试看哦', 230, 200);
throw new UserError('没有找到这个ck账户,重新登录试试看哦', 230, 200);
}
this.cookie = env.value;

const remarks = `remark=${this.remark};`;

const updateEnvBody = await updateEnv(this.cookie, this.eid, remarks);
if (updateEnvBody.code !== 200) {
throw new UserError('更新/上传备注出错,请重试', 241, 200);
throw new UserError('ck更新/上传备注出错,请重试', 241, 200);
}

return {
message: '更新/上传备注成功',
message: 'ck更新/上传备注成功',
};
}

Expand Down Expand Up @@ -358,7 +358,7 @@ module.exports = class User {

async updateWSCKRemark() {
if (!this.wseid || !this.remark || this.remark.replace(/(^\s*)|(\s*$)/g, '') === '') {
throw new UserError('参数错误', 240, 200);
throw new UserError('wseid参数错误', 240, 200);
}

const envs = await getWSCKEnvs();
Expand All @@ -372,11 +372,11 @@ module.exports = class User {

const updateEnvBody = await updateWSCKEnv(this.jdwsck, this.wseid, remarks);
if (updateEnvBody.code !== 200) {
throw new UserError('更新/上传备注出错,请重试', 241, 200);
throw new UserError('wskey更新/上传备注出错,请重试', 241, 200);
}

return {
message: '更新/上传备注成功',
message: 'wskey更新/上传备注成功',
};
}

Expand Down

0 comments on commit 0f9e4c8

Please sign in to comment.