             let json = jsonResponse.responseJsonObject()
             if let result = json as? Dictionary<String,Any> {
                 if let balance = result["balance"] as? Double {
-                    let str = self.numberFormatter.string(from: NSNumber(value: balance))
-                    self.nameLabel.text = str?.components(separatedBy: "￥").last?.components(separatedBy: "¥").last?.components(separatedBy: "$").last
-                    if balance > 999999.0 {
-                        self.nameLabel.adjustsFontSizeToFitWidth = true
-                    }
-                    ShareModel.share().userMoney = balance
-                    DispatchQueue.main.async {
-                        UserModel.updateUser(info: { (result)-> ()? in
-                            UserModel.share().currentUser?.balance = balance
-                        })
-                    }
-                    
-                    
+                    self.setBalanceText(balance: balance)
                 }
             }
-            
             return nil
         }
         

    }
    
    deinit {
        NotificationCenter.default.removeObserver(self)
    }
    

        
      
    }
    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
        
        if keyPath == "balance" {
            guard UserModel.share().currentUser != nil else { return }
            setBalanceText(balance: (UserModel.share().currentUser?.balance)!)
        }
        
    }
    
    func formatMoneyString(balance:Double) -> String? {
       let str = numberFormatter.string(from: NSNumber(value: balance))
        return str?.components(separatedBy: "￥").last?.components(separatedBy: "¥").last?.components(separatedBy: "$").last
    }
    
    func setBalanceText(balance:Double) {
        nameLabel.text = formatMoneyString(balance: balance)
        if balance > 999999.0 {
            nameLabel.adjustsFontSizeToFitWidth = true
        }
        ShareModel.share().userMoney = balance
        DispatchQueue.main.async {
            UserModel.updateUser(info: { (result)-> ()? in
                UserModel.share().currentUser?.balance = balance
            })
        }
    }
    

    func initReceiveBalanceBlock() {
        SocketRequestManage.shared.receiveBalanceBlock = { (response) in
