The first detected gravitational wave GW170817 from a binary neutron star merger is associated with an important optical transient AT 2017gfo, which is a direct observation of kilonova. Recent observations suggest that the remnant compact object of the binary neutron star merger associated with GW170817/GRB 170817A may be a stable long-lived magnetized neutron star. In this situation, there would be a pulsar wind nebula (PWN) embedded inside the dynamic ejecta. The PWN emission may be absorbed by the ejecta or leak out of the system. We study the effect of the PWN emission on the observed light curves and radiation spectra. Different from previous works, the absorption and leakage of the PWN emission are all involved in our model, where the absorption of the PWN emission heats up the ejecta and alters its radiation. It is found that the characteristic emission of the embedded PWN quickly evolves. For the multiband and long-term observations of AT 2017gfo, we find that the dynamic ejecta with a PWN emission can fit the observational data very well, especially for the light curves at $tsim 5$ days and those in the late phase. In addition, our model can naturally generate the thermal to nonthermal spectrum evolution of AT 2017gfo. Our fitting result suggests that a PWN is embedded in the AT 2017gfo.