Direct entanglement measurement of Werner state with cavity-assisted spin–photon interaction system