mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
16 lines
242 B
JavaScript
16 lines
242 B
JavaScript
|
|
export class Ret {
|
||
|
|
constructor (code = 0, msg, data) {
|
||
|
|
this.code = code
|
||
|
|
this.msg = msg
|
||
|
|
this.data = data
|
||
|
|
}
|
||
|
|
|
||
|
|
static success (data) {
|
||
|
|
return new Ret(0, '', data)
|
||
|
|
}
|
||
|
|
|
||
|
|
static error (msg) {
|
||
|
|
return new Ret(1, msg)
|
||
|
|
}
|
||
|
|
}
|