finish user part function and fix some bugs about login