parent
b207971b6e
commit
dd5a1cec86
41
Readme.md
41
Readme.md
|
@ -1,12 +1,45 @@
|
|||

|
||||
|
||||
# @gm5/controller
|
||||

|
||||

|
||||
|
||||
> 控制器基类。
|
||||
# @gm5/mail
|
||||
|
||||
> 一个简单的邮件发送模块, 可用于发送系统邮件, 如注册验证等。
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
npm install @gm5/controller
|
||||
npm i @gm5/mail
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
```js
|
||||
|
||||
import { createApp } from '@gm5/code'
|
||||
import { MailModule } from '@gm5/mail'
|
||||
|
||||
var app = createApp()
|
||||
|
||||
app.install(MailModule, {
|
||||
auth: {
|
||||
user: 'example@example.com',
|
||||
username: 'example',
|
||||
pass: '123456'
|
||||
}
|
||||
})
|
||||
.run()
|
||||
|
||||
|
||||
|
||||
// in controller
|
||||
|
||||
this.context.$$mail
|
||||
.to('tom@xx.com', 'tom')
|
||||
.send({
|
||||
subject: 'hello',
|
||||
text: 'how are you?',
|
||||
html: '<p>how are you?</p>'
|
||||
})
|
||||
|
||||
```
|
Loading…
Reference in New Issue