Skip to content

Commit 9db7fb4

Browse files
author
pedro
committed
fix:修复模型扩展的问题
1 parent 2c33a84 commit 9db7fb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/models/user.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
'use strict';
88

99
const { modelExtend } = require('lin-mizar/lin/factory');
10+
const { UserInterface } = require('lin-mizar/lin/interface');
1011
const { User } = require('lin-mizar');
1112
const Sequelize = require('sequelize');
1213

13-
const User2 = modelExtend(User, {
14-
phone: {
15-
type: Sequelize.STRING(30),
16-
unique: true,
14+
modelExtend(UserInterface, {
15+
openid: {
16+
type: Sequelize.STRING(64),
1717
allowNull: true
1818
}
1919
});
2020

21-
User2.prototype.sayHello = function () {
21+
User.prototype.sayHello = function () {
2222
console.log('hello world!');
2323
};
2424

25-
module.exports = { User2 };
25+
module.exports = { User };

0 commit comments

Comments
 (0)