WebApi防重复提交方案

使用Redis锁机制。

偽代碼:

void post
{
	var key = GetKey();
        var value = Redis.Incre(key);
        if(value == 1)
        {
            var key = GetKey();
            var value = Redis.Incre(key);
            if(value == 1)
            {
        	do();
            }
            Redis.Decre(key);
        }
}
原文地址:https://www.cnblogs.com/pengzhen/p/5924386.html