fix: 修复支付可能存在的缺陷
This commit is contained in:
@@ -6,9 +6,9 @@ const PaySchema = new Schema({
|
||||
ref: 'user',
|
||||
required: true
|
||||
},
|
||||
time: {
|
||||
type: Number,
|
||||
default: () => Date.now()
|
||||
createTime: {
|
||||
type: Date,
|
||||
default: () => new Date()
|
||||
},
|
||||
price: {
|
||||
type: Number,
|
||||
@@ -17,6 +17,12 @@ const PaySchema = new Schema({
|
||||
orderId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
status: {
|
||||
// 支付的状态
|
||||
type: String,
|
||||
default: 'NOTPAY',
|
||||
enum: ['SUCCESS', 'REFUND', 'NOTPAY', 'CLOSED']
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ const UserSchema = new Schema({
|
||||
},
|
||||
balance: {
|
||||
type: Number,
|
||||
default: 0.5
|
||||
default: 0.5 * 100000
|
||||
},
|
||||
accounts: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user