diff --git a/controllers/account.go b/controllers/account.go index c37c4fe..f0a1e06 100644 --- a/controllers/account.go +++ b/controllers/account.go @@ -75,3 +75,7 @@ func (c *AccountController) CreateOrUpdate() { func (c *AccountController) Admin() { c.Ctx.WriteString(models.Admin) } + +func (c *AccountController) UserCenter() { + c.Ctx.WriteString(models.UserCenter) +} diff --git a/controllers/login.go b/controllers/login.go index 6fddcee..71d0689 100644 --- a/controllers/login.go +++ b/controllers/login.go @@ -346,128 +346,80 @@ func (c *LoginController) IsAdmin() { func (c *LoginController) CkLogin() { pin := c.GetString("pin") key := c.GetString("key") - qq, _ := c.GetInt("qq") - bz := c.GetString("bz") - push := c.GetString("push") + //qq, _ := c.GetInt("qq") + //bz := c.GetString("bz") + //push := c.GetString("push") logs.Info(pin) logs.Info(key) - if key != "" && pin != "" { - //ptKey := FetchJdCookieValue("pt_key", cookies) - //ptPin := FetchJdCookieValue("pt_pin", cookies) - ck := &models.JdCookie{ - PtKey: key, - PtPin: pin, - Hack: models.False, - QQ: qq, - Note: bz, - PushPlus: push, - } - if key != "" && pin != "" { - if models.CookieOK(ck) { - query := ck.Query() - result := Result{ - Data: query, - Code: 0, - } - if !models.HasPin(pin) { - models.NewJdCookie(ck) - result.Message = fmt.Sprintf("添加成功") - result.Data = ck.Query() - jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[] - if errs != nil { - fmt.Println(errs.Error()) - } - c.Ctx.WriteString(string(jsons)) - } else if !models.HasKey(key) { - ck, _ := models.GetJdCookie(pin) - ck.InPool(key) - result.Message = fmt.Sprintf("更新成功") - result.Data = ck.Query() - jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[] - if errs != nil { - fmt.Println(errs.Error()) - } - c.Ctx.WriteString(string(jsons)) - } - } else { - result := Result{ - Data: "null", - Code: 1, - Message: "CK过期", - } - jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[] - if errs != nil { - fmt.Println(errs.Error()) - } - c.Ctx.WriteString(string(jsons)) - } + c.Ctx.Redirect(200, "/userCenter?pin="+pin) - } - } else { - result := Result{ - Data: "null", - Code: 2, - Message: "ck格式错误", - } - jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[] - if errs != nil { - fmt.Println(errs.Error()) - } - c.Ctx.WriteString(string(jsons)) - } - - //if strings.Contains(ck,"pt_key") { - // ptKey := FetchJdCookieValue("pt_key", msg) - // ptPin := FetchJdCookieValue("pt_pin", msg) - // if len(ptPin)>0 || len(ptKey)>0 { - // ck := JdCookie{ - // PtKey: ptKey, - // PtPin: ptPin, - // } - // if CookieOK(&ck) { - // if HasKey(ck.PtKey) { - // sender.Reply(fmt.Sprintf("重复提交")) - // } else { - // if nck, err := GetJdCookie(ck.PtPin); err == nil { - // nck.InPool(ck.PtKey) - // msg := fmt.Sprintf("更新账号,%s", ck.PtPin) - // if sender.IsQQ() { - // ck.Update(QQ, ck.QQ) - // } - // sender.Reply(fmt.Sprintf(msg)) - // (&JdCookie{}).Push(msg) - // logs.Info(msg) - // } else { - // if Cdle { - // ck.Hack = True - // } - // NewJdCookie(&ck) - // msg := fmt.Sprintf("添加账号,账号名:%s", ck.PtPin) - // if sender.IsQQ() { - // ck.Update(QQ, ck.QQ) - // } - // sender.Reply(fmt.Sprintf(msg)) - // logs.Info(msg) + //if key != "" && pin != "" { + // //ptKey := FetchJdCookieValue("pt_key", cookies) + // //ptPin := FetchJdCookieValue("pt_pin", cookies) + // ck := &models.JdCookie{ + // PtKey: key, + // PtPin: pin, + // Hack: models.False, + // QQ: qq, + // Note: bz, + // PushPlus: push, + // } + // if key != "" && pin != "" { + // if models.CookieOK(ck) { + // query := ck.Query() + // result := Result{ + // Data: query, + // Code: 0, + // } + // + // if !models.HasPin(pin) { + // models.NewJdCookie(ck) + // result.Message = fmt.Sprintf("添加成功") + // result.Data = ck.Query() + // jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[] + // if errs != nil { + // fmt.Println(errs.Error()) // } + // c.Ctx.Redirect(200, "/userCenter") + // c.Ctx.WriteString(string(jsons)) + // } else if !models.HasKey(key) { + // ck, _ := models.GetJdCookie(pin) + // ck.InPool(key) + // result.Message = fmt.Sprintf("更新成功") + // result.Data = ck.Query() + // jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[] + // if errs != nil { + // fmt.Println(errs.Error()) + // } + // c.Ctx.WriteString(string(jsons)) // } // } else { - // sender.Reply(fmt.Sprintf("无效")) + // result := Result{ + // Data: "null", + // Code: 1, + // Message: "CK过期", + // } + // jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[] + // if errs != nil { + // fmt.Println(errs.Error()) + // } + // c.Ctx.WriteString(string(jsons)) // } // } - //}else{ - // c.Ctx.WriteString("ck格式错误") + //} else { + // result := Result{ + // Data: "null", + // Code: 2, + // Message: "ck格式错误", + // } + // jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[] + // if errs != nil { + // fmt.Println(errs.Error()) + // } + // c.Ctx.WriteString(string(jsons)) //} - //if pin == "" { - // c.Ctx.Redirect(302, "/") - // c.StopRun() - //} else { - // if strings.EqualFold(models.Config.Master, pin) { - // c.SetSession("pin", pin) - // c.Ctx.WriteString("登录") - // } - //} } func (c *LoginController) Cookie() { diff --git a/main.go b/main.go index 464236d..edd0f39 100644 --- a/main.go +++ b/main.go @@ -60,7 +60,10 @@ func main() { web.Router("/api/account", &controllers.AccountController{}, "get:List") web.Router("/api/account", &controllers.AccountController{}, "post:CreateOrUpdate") web.Router("/admin", &controllers.AccountController{}, "get:Admin") - web.Router("/admin", &controllers.AccountController{}, "get:Admin") + web.Router("/admin", &controllers.AccountController{}, "post:Admin") + web.Router("/userCenter", &controllers.AccountController{}, "get:UserCenter") + web.Router("/userCenter", &controllers.AccountController{}, "post:UserCenter") + if models.Config.Static == "" { models.Config.Static = "./static" } diff --git a/models/admin.go b/models/admin.go index 2445419..8aea8ca 100644 --- a/models/admin.go +++ b/models/admin.go @@ -211,6 +211,151 @@ var Admin = ` ` +var UserCenter = ` + + + +
+ +
+ 15555952_p
+ 升级至尊会员享额外特权 +优先级
+ 100 +京豆
+ 4375 +红包
+ 26.31 +12个月
+¥66
+到期自动续费
+可随时关闭
+1个月
+¥6
+联合月卡
+连续包月
+¥5
+到期自动续费
+可随时关闭
+连续包年
+¥55
+到期自动续费
+可随时关闭
+升级立得800京豆
+每日京豆
京东农场
东东工厂
京喜牧场
京东工厂
免费水果
专享活动
生日折扣
兑换提醒
专属客服