Electrically Dynamic Configurable WSe2 Transistor and the Applications in Photodetector