I tried an official ac adapter I recently found and it has been working pretty well till nowI would test the power brick. I think that's the psu for the wii u. if that's not it, I'd see if it's overheating somehow. make sure the vents aren't covered. I originally had my wii u upside down, but it didn't harm it. I have it the right way now. it's been like that for a couple of years or so.
Yes the official ac adapter I found works better than the 3rd party one I got, My Wii U isn't turning off anymore. Thanks! and I am using the Wii U rubber feet.btw, the vents should be on top if the the system is vertical, which is how I made that mistake as my system is using the rubber feet or whatever. make sure the wii u isn't upside down where the vents are on the bottom. it's easy to make that mistake.
try another power brick.