You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
533 B
18 lines
533 B
// agent.js
|
|
const md5 = require('md5');
|
|
module.exports = agent => {
|
|
// 在这里写你的初始化逻辑。
|
|
|
|
// 你还可以通过 messenger 对象发送消息给 App Worker。
|
|
// 但是,需要等 App Worker 启动成功后才能发送,否则可能丢失消息。
|
|
agent.messenger.on('egg-ready', () => {
|
|
let params = {
|
|
subType: "add",
|
|
name: "admin",
|
|
password: md5("admin"),
|
|
email: "admin@admin.com",
|
|
allowRegist: true,
|
|
}
|
|
agent.messenger.sendToApp('createAdmin', params);
|
|
});
|
|
};
|