@@ -134,6 +134,8 @@ func CronScheduled(ctx context.Context) {
// //圣牧自动同步前天有进行中的任务
manualUdData(pastureinfo)
+ tx.Exec(` insert into saplog(pastureId,request,response,status,msgtext,createTime,msgtype,dataDate,url)
+ values(?,?,?,?,?,now(),?,?,?)`, pastureinfo.Pastureid, "1", "", "", "", 10, "1990-01-01", "https://wdc.unidairy.cn/copartner_uploads/")
//现代牧业sap同步
// xdmy := cron.New()
// xdmy.AddFunc("50 04 * * *", func() {
@@ -57,8 +57,11 @@ func Auth(c *gin.Context) {
}
if !isExist {
- appG.Response(http.StatusInternalServerError, e.ERROR_AUTH, "")
- return
+ isExist, err = authService.MD5Check()
+ if !isExist {
+ appG.Response(http.StatusInternalServerError, e.ERROR_AUTH, "")
+ return
+ }
token, err := util.GenerateToken(reqInfo.Username, reqInfo.Password)
@@ -2,6 +2,7 @@ package user_service
import (
"tmr-watch/http/handle/restful"
+ "tmr-watch/pkg/util"
"github.com/casbin/casbin"
)
@@ -26,7 +27,10 @@ type User struct {
func (a *User) Check() (bool, error) {
return restful.CheckUser(a.Username, a.Password)
+}
+func (a *User) MD5Check() (bool, error) {
+ return restful.CheckUser(a.Username, util.EncodeMD5(a.Password))
func (a *User) CheckFace() (bool, error) {