用adb执行下面代码即可
adb shell settings delete global captive_portal_mode ;\
adb shell settings put global captive_portal_mode 0 ;\
adb shell settings get global captive_portal_mode ;\
adb shell settings delete global captive_portal_https_url ;\
adb shell settings delete global captive_portal_http_url ;\
adb shell settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204 ;\
adb shell settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204
然后打开飞行模式, 然后再关闭飞行模式就可以了