|
- package zhimeng_platform
-
- import (
- "applet/app/db"
- "applet/app/e"
- sms2 "applet/app/lib/sms"
- "applet/app/svc/platform"
- "applet/app/utils"
- "encoding/json"
- "fmt"
- "github.com/gin-gonic/gin"
- "github.com/syyongx/php2go"
- "math/rand"
- "time"
- )
-
- func WithdrawalIncome(c *gin.Context) {
- platform.WithdrawalIncome(c)
- }
- func WithdrawalList(c *gin.Context) {
- platform.WithdrawalList(c)
- }
- func WithdrawalDoing(c *gin.Context) {
- platform.WithdrawalDoing(c)
- }
- func WithdrawalOutput(c *gin.Context) {
- platform.WithdrawalOutput(c)
- }
- func WithdrawalInvoiceImg(c *gin.Context) {
- platform.WithdrawalInvoiceImg(c)
- }
- func WithdrawalBindAlipay(c *gin.Context) {
- platform.WithdrawalBindAlipay(c)
- }
- func Sms(c *gin.Context) {
- if c.GetString("is_system") == "" {
- e.OutErr(c, 400, e.NewErr(400, "请重新在后台进入聚合联盟"))
- return
- }
- if c.GetString("is_system") != "1" {
- e.OutErr(c, 400, e.NewErr(400, "请使用超管账号设置"))
- return
- }
- appName := db.SysCfgGet(c, "sms_push_sign")
- captcha := createCaptcha()
- content := fmt.Sprintf("【%s】验证码:%s", appName, captcha)
- templateCode := ""
- marshal, _ := json.Marshal(c.Request.Header)
- waykeys := "zhimeng_" + c.ClientIP() + "_" + utils.IntToStr(utils.GetApiVersion(c)) + "_" + c.Request.RequestURI + "_" + string(marshal)
- postData := map[string]interface{}{
- "content": content,
- "mobile": c.GetString("phone"),
- "templateCode": templateCode,
- "way": php2go.Base64Encode(waykeys),
- }
- err := sms2.GetSmsConfig(c, "86", postData)
- if err != nil {
- e.OutErr(c, 400, err.Error())
- return
- }
- e.OutSuc(c, "success", nil)
- return
- }
- func createCaptcha() string {
- return fmt.Sprintf("%05v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(1000000))
- }
|