فهرست منبع

feat:注销用户同步注销用户中台

zhangxinlei1996 3 سال پیش
والد
کامیت
8a9cbb4e4d
1فایلهای تغییر یافته به همراه10 افزوده شده و 2 حذف شده
  1. 10 2
      src/jfw/modules/app/src/app/front/logoffuser.go

+ 10 - 2
src/jfw/modules/app/src/app/front/logoffuser.go

@@ -2,9 +2,12 @@ package front
 
 import (
 	. "api"
+	"jfw/config"
 	"jfw/public"
 	"log"
+	"net/http"
 	qutil "qfw/util"
+	"qfw/util/usercenter"
 	"time"
 
 	"github.com/go-xweb/xweb"
@@ -118,11 +121,16 @@ func LogOffAppUser(user_id, cause string) bool {
 		_id, _ := primitive.ObjectIDFromHex(user_id)
 		if mongodb.Del("user", map[string]interface{}{
 			"_id": _id,
-			// "_id": bson.ObjectIdHex(ok),
 		}) {
+			//删除用户中台
+			ck := &http.Cookie{}
+			base_userid_del := usercenter.GetBaseUserId(mongodb, user_id)
+			usercenter.PostUserCenter(qutil.ObjToString(config.Sysconfig["userCenterApi"])+usercenter.UserCenterDelete, usercenter.ContentType_Json, user_id, map[string]interface{}{
+				"appid": "10000",
+				"id":    base_userid_del,
+			}, ck)
 			return true
 		}
-		// return true
 	}
 	return false
 }