mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-25 16:58:06 +08:00
add aaa.email
This commit is contained in:
parent
2af0963fd2
commit
42d66bbd94
1
Makefile
1
Makefile
@ -9,6 +9,7 @@ install:
|
|||||||
@go get github.com/gomarkdown/markdown
|
@go get github.com/gomarkdown/markdown
|
||||||
@go get github.com/PuerkitoBio/goquery
|
@go get github.com/PuerkitoBio/goquery
|
||||||
@go get github.com/go-cas/cas
|
@go get github.com/go-cas/cas
|
||||||
|
@go get github.com/gopkg.in/gomail.v2
|
||||||
GOPATH=$(PWD):$(GOPATH) go install $(BENCH)
|
GOPATH=$(PWD):$(GOPATH) go install $(BENCH)
|
||||||
@date
|
@date
|
||||||
# bench web.code.counter nmake 1
|
# bench web.code.counter nmake 1
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package aaa
|
package aaa
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"gopkg.in/gomail.v2"
|
||||||
"contexts/ctx"
|
"contexts/ctx"
|
||||||
"crypto"
|
"crypto"
|
||||||
"crypto/aes"
|
"crypto/aes"
|
||||||
@ -128,6 +129,11 @@ var Index = &ctx.Context{Name: "aaa", Help: "认证中心",
|
|||||||
}, Help: "散列"},
|
}, Help: "散列"},
|
||||||
|
|
||||||
"expire": &ctx.Config{Name: "expire(s)", Value: "72000", Help: "会话超时"},
|
"expire": &ctx.Config{Name: "expire(s)", Value: "72000", Help: "会话超时"},
|
||||||
|
"email": &ctx.Config{Name: "email", Value: map[string]interface{}{
|
||||||
|
"self": "shylinux@163.com",
|
||||||
|
"smtp": "smtp.163.com",
|
||||||
|
"port": "25",
|
||||||
|
}, Help: "会话超时"},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ctx.Command{
|
Commands: map[string]*ctx.Command{
|
||||||
"_init": &ctx.Command{Name: "_init", Help: "数字摘要", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
"_init": &ctx.Command{Name: "_init", Help: "数字摘要", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||||
@ -712,6 +718,21 @@ var Index = &ctx.Context{Name: "aaa", Help: "认证中心",
|
|||||||
return
|
return
|
||||||
}},
|
}},
|
||||||
|
|
||||||
|
"email": &ctx.Command{Name: "email", Help: "数字摘要", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||||
|
msg := gomail.NewMessage()
|
||||||
|
msg.SetHeader("From", m.Conf("email", "self"))
|
||||||
|
msg.SetHeader("To", arg[0])
|
||||||
|
msg.SetHeader("Subject", arg[1])
|
||||||
|
msg.SetBody("text/html", strings.Join(arg[2:], ""))
|
||||||
|
d := gomail.NewDialer(m.Conf("email", "smtp"), kit.Int(m.Conf("email", "port")), m.Conf("email", "self"), m.Conf("email", "code"))
|
||||||
|
if e := d.DialAndSend(msg); e != nil {
|
||||||
|
m.Echo("%v", e)
|
||||||
|
} else {
|
||||||
|
m.Echo("success")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}},
|
||||||
|
|
||||||
"relay": &ctx.Command{Name: "relay check hash | share role", Help: "授权", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
"relay": &ctx.Command{Name: "relay check hash | share role", Help: "授权", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||||
if len(arg) == 0 { // 会话列表
|
if len(arg) == 0 { // 会话列表
|
||||||
m.Cmdy("aaa.auth", "relay")
|
m.Cmdy("aaa.auth", "relay")
|
||||||
|
@ -146,6 +146,7 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
|||||||
"github.com/gomodule/redigo",
|
"github.com/gomodule/redigo",
|
||||||
"github.com/go-sql-driver/mysql",
|
"github.com/go-sql-driver/mysql",
|
||||||
"github.com/gomarkdown/markdown",
|
"github.com/gomarkdown/markdown",
|
||||||
|
"github.com/gopkg.in/gomail.v2",
|
||||||
"github.com/skip2/go-qrcode",
|
"github.com/skip2/go-qrcode",
|
||||||
"github.com/PuerkitoBio/goquery",
|
"github.com/PuerkitoBio/goquery",
|
||||||
"github.com/go-cas/cas",
|
"github.com/go-cas/cas",
|
||||||
@ -762,7 +763,7 @@ var version = struct {
|
|||||||
m.Add("append", "status", "stop")
|
m.Add("append", "status", "stop")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
m.Sort("status").Table()
|
m.Sort("you", "str_r").Sort("status").Table()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,5 +4,5 @@ var version = struct {
|
|||||||
host string
|
host string
|
||||||
self int
|
self int
|
||||||
}{
|
}{
|
||||||
"2019-07-02 17:07:03", "ZYB-20190522USI", 84,
|
"2019-07-02 20:23:38", "ZYB-20190522USI", 85,
|
||||||
}
|
}
|
||||||
|
@ -652,6 +652,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
res, e := web.Client.Do(req)
|
res, e := web.Client.Do(req)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
m.Log("warn", "%v", e)
|
m.Log("warn", "%v", e)
|
||||||
|
m.Echo("%v", e)
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,6 +167,10 @@ fieldset.Login>form.option button {
|
|||||||
height:28px;
|
height:28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fieldset.item>div.output {
|
||||||
|
overflow:auto;
|
||||||
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user