Zhang Hansi (張漢思) was a military officer of the Chinese Five Dynasties and Ten Kingdoms Period state Min. After Min's fall, he served under Liu Congxiao, who controlled Qingyuan Circuit (headquartered in modern Quanzhou, Fujian), in nominal submission to Southern Tang. After Liu's death, the officer Chen Hongjin overthrew Liu's nephew and successor Liu Shaozi and supported Zhang, but later overthrew Zhang as well and took over himself.
During Min.
It is not known when Zhang Hansi was born or what his geographic origins were, as there were no biographies of his in traditional histories—although he was described as being old aged at the time of his eventual death. In any case, as of 944, he was serving as an army officer at Min's Quan Prefecture (泉州, in modern Quanzhou, Fujian). At that time, the Min state was in turmoil, as the general Zhu Wenjin had just assassinated the emperor Wang Yanxi (Emperor Jingzong) and seized the throne, and was battling with Wang Yanxi's younger brother Wang Yanzheng (who had earlier declared himself the emperor of a new branch state of Yin) for the control of the realm.
Zhu, after his coup, sent the general Huang Shaopo (黃紹頗) to serve as the prefect of Quan. Zhang's colleague Liu Congxiao encouraged other officers, including Wang Zhongshun (王忠順), Zhang, and Dong Si'an (董思安) to join him in a plot against Huang, arguing that they, having been the long-term subjects of Min's ruling Wang family, could not stand by and allow Zhu to take over. They agreed, and they assassinated Huang and supported Wang Yanzheng's nephew Wang Jixun (王繼勳) to serve as the acting prefect, pledging their allegiance to Wang Yanzheng. Wang Yanzheng subsequently commissioned Wang Jixun as prefect and gave commander titles to Liu, Wang Zhongshun, Dong, and Chen Hongjin—with no reference to Zhang at that point.
After Min's fall.
Wang Yanzheng's realm, however, was subsequently conquered by Min's northern neighbor Southern Tang. Liu Congxiao seized control of the Quan region, which became known as Qingyuan Circuit, in nominal submission to Southern Tang—and, after Southern Tang eventually had to itself formally submit to Later Zhou and then Later Zhou's successor state Song as a vassal—to both Southern Tang and Song.
Liu Congxiao apparently died in 962. Under the account given in the "Xu Zizhi Tongjian" (also adopted in the "Spring and Autumn Annals of the Ten Kingdoms"), after Liu Congxiao's death, as Liu Shaoji was then on a tributary mission sent by Liu Congxiao to the Southern Tang court, Liu Shaozi took over as acting military governor. However, not long after, Chen Hongjin seized him and falsely accused him of planning to submit to Wuyue, and then delivered him to Southern Tang and supported Zhang Hansi, who was then the deputy military governor, as the new acting military governor. Under the account in Liu's biography in the "History of Song", the coup happened before Liu Congxiao's death, and therefore (implicitly) Liu Shaozi never controlled the circuit—but under Chen's biography, it gave the same account as the "Xu Zizhi Tongjian" (i.e., the coup was during Liu Shaozi's rule).
It was said, though, that Zhang, on account of his old age, was incapable of governing the circuit, and most of the matters ended up being decided by Chen, whom he made the deputy military governor. Zhang was apprehensive about Chen's hold over the governance, and held a feast, intending to set a trap for Chen at the feast and kill him. Before the ambush could occur, however, an earthquake happened, shocking Zhang's adherents, who then informed Chen. Chen immediately left the feast before he could be ambushed. Zhang, now fearing that Chen would act first, had his own headquarters put under heavy guard. In summer 963, Chen took his soldiers and headed for Zhang's headquarters. When arriving at the headquarters, rather than attacking it, he simply ordered Zhang's guards to disperse, and the guards, apparently intimidated, did so. He then entered the headquarters and, finding Zhang in the inner chambers, locked the inner chambers, stating to him, "The soldiers and the civilian administrators all thought you, Lord, to be senile and crazy. They asked me, Chen Hongjin, to take over on an acting basis. You cannot resist the will of the people. Please yield your seal." Zhang, surprised and not able to think what else to do, turned his seal to Chen, who then announced the transition to the officers and administrators and took over control of the circuit. Chen moved Zhang to a retreat home and put him under house arrest there, under heavy guard. Zhang died of natural causes several years later.