Control radiative heat transfer and Casimir force by regulating chemical potential of photons