|
|
|
@ -5,6 +5,8 @@
|
|
|
|
|
package web
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
|
|
"github.com/alimy/cfg"
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
api "github.com/rocboss/paopao-ce/auto/api/v1"
|
|
|
|
@ -15,8 +17,14 @@ import (
|
|
|
|
|
"github.com/smartwalle/alipay/v3"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
_EnablePhoneVerify bool
|
|
|
|
|
_onceInitial sync.Once
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// RouteWeb register web route
|
|
|
|
|
func RouteWeb(e *gin.Engine) {
|
|
|
|
|
initial()
|
|
|
|
|
oss := dao.ObjectStorageService()
|
|
|
|
|
ds := &base.DaoServant{
|
|
|
|
|
Redis: conf.Redis,
|
|
|
|
@ -66,3 +74,10 @@ func mustAlipayClient() *alipay.Client {
|
|
|
|
|
}
|
|
|
|
|
return client
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// initial do some package lazy initialize for performance
|
|
|
|
|
func initial() {
|
|
|
|
|
_onceInitial.Do(func() {
|
|
|
|
|
_EnablePhoneVerify = cfg.If("Sms")
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|