fix: 修复支付可能存在的缺陷

This commit is contained in:
archer
2023-03-22 12:20:27 +08:00
parent 984baf60f0
commit 5ec303610c
12 changed files with 266 additions and 93 deletions

View File

@@ -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']
}
});

View File

@@ -16,7 +16,7 @@ const UserSchema = new Schema({
},
balance: {
type: Number,
default: 0.5
default: 0.5 * 100000
},
accounts: [
{