🎉 wechat corp message supported
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ const sequelize = require('../common/database');
|
||||
Message.belongsTo(User);
|
||||
|
||||
(async () => {
|
||||
await sequelize.sync({ alter: true });
|
||||
await sequelize.sync();
|
||||
console.log('Database initialized.');
|
||||
const isNoAdminExisted =
|
||||
(await User.findOne({ where: { isAdmin: true } })) === null;
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@ Message.init(
|
||||
description: DataTypes.TEXT,
|
||||
content: DataTypes.TEXT,
|
||||
type: {
|
||||
type: DataTypes.INTEGER,
|
||||
defaultValue: 0,
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: 'test',
|
||||
},
|
||||
},
|
||||
{ sequelize }
|
||||
|
||||
@@ -37,17 +37,28 @@ User.init(
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: false,
|
||||
},
|
||||
defaultMethod:{
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: 'test'
|
||||
},
|
||||
// WeChat public account
|
||||
wechatAppId: DataTypes.STRING,
|
||||
wechatAppSecret: DataTypes.STRING,
|
||||
wechatTemplateId: DataTypes.STRING,
|
||||
wechatOpenId: DataTypes.STRING,
|
||||
wechatVerifyToken: DataTypes.STRING,
|
||||
// Email
|
||||
smtpServer: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: 'smtp.qq.com',
|
||||
},
|
||||
smtpUser: DataTypes.STRING,
|
||||
smtpPass: DataTypes.STRING,
|
||||
// WeChat corporation
|
||||
corpId: DataTypes.STRING,
|
||||
corpAgentId: DataTypes.STRING,
|
||||
corpAppSecret: DataTypes.STRING,
|
||||
corpUserId: DataTypes.STRING
|
||||
},
|
||||
{ sequelize }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user