Recognition of Mg2+ and Zn2+ based on a naphthalene-based fluorescent probe by regulating solvents