add two login method

Signed-off-by: scauwjh <scauwjh@gmail.com>
1.fixed the bug: if server is shutdown.....

Signed-off-by: scauwjh <scauwjh@gmail.com>