🐛 删除不用的代码 & 修改时间

This commit is contained in:
sugarBecomer
2025-12-02 10:53:16 +08:00
parent 6eb4bc6d8a
commit 5ba9e38e1a
2 changed files with 1 additions and 52 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ url = "https://devocr.likedream.xyz"
[database]
type = "mysql"
dsn = "test_likedream_go:EpXckXmxawDEQGxJ@tcp(database.out:3306)/test_likedream_go?parseTime=true"
dsn = "test_likedream_go:EpXckXmxawDEQGxJ@tcp(database.out:3306)/test_likedream_go?parseTime=true&loc=Asia%2FShanghai"
dsn2 = "host=database.out user=dev password=JPmKjmpcaG3EYAJZ dbname=dev port=5432 sslmode=disable TimeZone=Asia/Shanghai"
# host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai
[server]
@@ -1,51 +0,0 @@
package login
import (
"context"
"encoding/base64"
"likedream-goframe/internal/application/cpdaily/cryptoutil"
"likedream-goframe/internal/application/httpclient"
"github.com/bytedance/sonic"
"resty.dev/v3"
)
type CpdailyCodeLogin struct {
client *resty.Client
}
func NewCode(ctx context.Context) *CpdailyCodeLogin {
return &CpdailyCodeLogin{
client: httpclient.NewCpdailyClient(),
}
}
func (c *CpdailyCodeLogin) GetLoginCode(mobile string) {
mobileBytes := cryptoutil.AesEncrypt([]byte(mobile))
mobile = base64.StdEncoding.EncodeToString(mobileBytes)
c.client.R().SetBody(map[string]string{
"a": mobile,
"b": "first_v4",
}).Post("https://mobile.campushoy.com/app/auth/authentication/mobile/messageCode/v-8222")
}
func (c *CpdailyCodeLogin) LoginByCode(mobile, code string) {
type loginStruct struct {
C string `json:"c"`
D string `json:"d"`
E string `json:"e"`
F string `json:"f"`
}
data := loginStruct{
C: mobile,
D: code,
E: "CPDAILY",
F: "86",
}
marshal, _ := sonic.Marshal(data)
marshalBytes := cryptoutil.AesEncrypt(marshal)
c.client.R().SetBody(map[string]string{
"a": base64.StdEncoding.EncodeToString(marshalBytes),
"b": "first_v4",
}).Post("https://mobile.campushoy.com/app/auth/authentication/mobileLogin/v-8222")
}