2.0.14 • Published 7 years ago
return-msg v2.0.14
HEAD
return-msg
介绍
程序返回值标准.
使用说明
引用
npm install return-msg样例
import {IReturnMsg,ReturnMsg} from "return-msg";
const rr:ReturnMsg = new ReturnMsg();
console.log(rr.ok);
const result={greet:'hello'};
const r:IReturnMsg=rr.returnResult(result);
console.log(r);
const e:IReturnMsg=rr.returnErr(1);
console.log(e);
const err:any = {stack:'MongoError: E11000 duplicate key error collection This is an err test!!!'};
console.log(rr.test(err));返回信息库
{"errcode":0, "errmsg" :"ok"},
{"errcode":1,"errmsg":"用户名不存在!"},
{"errcode":2,"errmsg":"密码不正确!"},
{"errcode":3,"errmsg":"该用户名已经存在,请使用其它用户名!"},
{"errcode":4,"errmsg":"密码不符合校验条件!"},
{"errcode":901,"errmsg":"返回错误出现重复值,请检查!","errstack":"MongoError: E11000 duplicate key error collection"},
{"errcode":999,"errmsg":"出现系统错误,请联系开发人员!"}参与贡献
zx
end
2.0.14
7 years ago
2.0.13
7 years ago
2.0.12
7 years ago
2.0.11
7 years ago
2.0.10
7 years ago
2.0.9
7 years ago
2.0.8
7 years ago
2.0.7
7 years ago
2.0.6
7 years ago
2.0.5
7 years ago
2.0.4
7 years ago
2.0.3
7 years ago
2.0.2
7 years ago
2.0.1
7 years ago
2.0.0
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago