A new construction of constant-composition codes based on all known perfect nonlinear functions from Fqm to itself is presented, which provides a kind of unified constructions of constant-composition codes based on all known perfect nonlinear functions from F qm to itself.It is proved that the new constant-composition codes are optimal with respect to the Luo-Fu-Vinck-Chen bound, when m is an odd positive integer greater than 1.Finally, we point out that two constructions of constant-composition codes, proposed by Ding Cunsheng et al.in 2005, are equivalent to two special types of the new constant-composition codes.