ソースを参照

修改用户信息接口

kobe6258 1 ヶ月 前
コミット
afa8c44897

+ 14 - 8
common/component/wechat/wechat_client.go

@@ -179,10 +179,13 @@ type WxUserInfo struct {
 }
 
 type QRCodeRequest struct {
-	Path      string `json:"path"`
-	Width     int    `json:"width,omitempty"`
-	AutoColor bool   `json:"auto_color,omitempty"`
-	LineColor struct {
+	Page       string `json:"page"`
+	Scene      string `json:"scene"`
+	CheckPath  bool   `json:"check_path"`
+	Width      int    `json:"width,omitempty"`
+	EnvVersion string `json:"env_version"`
+	AutoColor  bool   `json:"auto_color,omitempty"`
+	LineColor  struct {
 		R int `json:"r"`
 		G int `json:"g"`
 		B int `json:"b"`
@@ -199,11 +202,14 @@ func (cli *Client) GenerateQRCode(code, path string) ([]byte, error) {
 	if err != nil {
 		return nil, err
 	}
-	api := fmt.Sprintf("%s%s?access_token=%s", baseURL, "/cgi-bin/wxaapp/createwxaqrcode", accessToken)
+	api := fmt.Sprintf("%s%s?access_token=%s", baseURL, "/wxa/getwxacodeunlimit", accessToken)
 	reqBody := QRCodeRequest{
-		Path:      path,
-		Width:     430,
-		AutoColor: true,
+		Page:       path,
+		Scene:      "id=32",
+		Width:      1280,
+		CheckPath:  false,
+		EnvVersion: "develop",
+		AutoColor:  true,
 		LineColor: struct {
 			R int `json:"r"`
 			G int `json:"g"`

+ 2 - 1
controllers/sys/sys_controller.go

@@ -60,7 +60,8 @@ func (s *SysController) GetConfig(config string) {
 func (s *SysController) GetQRCode(code string) {
 	controllers.Wrap(&s.BaseController, func() (result *controllers.WrapData, err error) {
 		result = s.InitWrapData("获取二维码失败")
-		path := "https://appchannel.htfutures.com:18086/channelqrcode/main/index.html#/regisApp?channelId=[4]10091"
+		//path := "https://appchannel.htfutures.com:18086/channelqrcode/main/index.html#/regisApp?channelId=[4]10091"
+		path := "pages/htfutures/account"
 		qrCode, err := configService.GetQRCode(code, path)
 		if err != nil {
 			err = exception.NewWithException(exception.WeChatQRCodeFailed, err.Error())

+ 3 - 1
service/user/user_service.go

@@ -235,9 +235,11 @@ func GetUserProfile(userId int) (userProfile UserProfile, err error) {
 	userProfile = convertUserDTOToProfile(userDTO)
 	if errors.Is(err, gorm.ErrRecordNotFound) {
 		userProfile.AccountStatus = "unopen"
+		err = nil
 		return
+	} else {
+		userProfile.AccountStatus = OfficialUser.AccountStatus
 	}
-	userProfile.AccountStatus = OfficialUser.AccountStatus
 	return
 }
 func GetAnalystDetail(userId int, analystId int) (analystDetail AnalystDetail, err error) {