feat: 修改计费模式为tokens
This commit is contained in:
@@ -31,6 +31,11 @@ const BillSchema = new Schema({
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
tokenLen: {
|
||||
// 折算成 token 的数量
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
price: {
|
||||
type: Number,
|
||||
required: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Schema, model, models } from 'mongoose';
|
||||
import { hashPassword } from '@/service/utils/tools';
|
||||
import { PRICE_SCALE } from '@/utils/user';
|
||||
|
||||
const UserSchema = new Schema({
|
||||
email: {
|
||||
@@ -16,7 +17,7 @@ const UserSchema = new Schema({
|
||||
},
|
||||
balance: {
|
||||
type: Number,
|
||||
default: 0.5 * 100000
|
||||
default: 0.5 * PRICE_SCALE
|
||||
},
|
||||
accounts: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user