That's bad news. It sounds like you've blown a mosfet or two in the controller, which is shorting out the battery as soon as you connect it. When the motor phase wires touch, blown mosfets is often the result.
The only problem now is that we don't know what caused the connectors to melt. It could be the result of another fault, so we need to test both the motor and the controller to see what needs to be sorted,
You will need a digital multi-meter to do the tests, so get one if you haven't got one. They're about £5 to £10 on Ebay.
Test 1. Disconnect everything from the controller. Measure the resistance between the black battery wire and each of the three motor phase wires. Each reading should be the same and somewhere around 7k to 14k. The exact result isn't important as long as you get the same for each. Repeat with the red battery wire to get another three results. Sometimes, the main capacitor in the controller causes the reading to continually climb or fall. That doesn't matter as long as all three do the same.
Test 2. You need to test that the motor hall sensors are switching, which will be tricky as you can't connect your battery. Basically, you need to apply 5v to the thin red and black wires in the 6-way white block connector, then measure the voltage on each of the other three between them and the black wire, while you rotate the wheel backwards. You should see the 5v switching on and off as the wheel rotates.
It might be worth getting one of these, which will make testing of the hall sensors and the motor very easy:
Can quickly test the quality of brushless motors. Can quickly test the brushless motor phase sequence ABC and abc color. It is possible to quickly test whether the phase angle is 60° or 120°. Detail Image.
www.ebay.co.uk
UK supplier
Quickly test whether the brushless motor coil is good or bad. Quickly test whether the the brushless motor phase sequence is ABC and abc colors. Quickly test whether the brushless motor hall's good or bad.
www.ebay.co.uk