Beispiel #1
0
        /// <summary>
        /// 流程处理
        /// </summary>
        /// <param name="instanceId">流程实例ID</param>
        /// <param name="suggestion">处理默认意见</param>
        /// <param name="handleType">处理类型</param>
        /// <param name="currentUrl">当前访问地址</param>
        /// <returns></returns>
        public ActionResult Handle(Guid instanceId,
                                   string suggestion,
                                   int handleType,
                                   int disagreeHandleType = -1)
        {
            var currentUrl = Request.Url.ToString().Replace(":8070", "");
            //JSSDK 签名
            var handler      = new JSSDKHandler(_corpAppService, Constants.MOBILE_APPROVAL_TEST);
            var result       = handler.GetSignature(currentUrl);
            var sdkConfigStr = JsonHandler.ToJson(new
            {
                appId     = result.AppId,     // 必填,企业号的唯一标识,此处填写企业号corpid
                timestamp = result.Timestamp, // 必填,生成签名的时间戳
                nonceStr  = result.Noncestr,  // 必填,生成签名的随机串
                signature = result.Signature  // 必填,签名,见附录1
            });

            var extraStr = JsonHandler.ToJson(new
            {
                instanceId,
                suggestion,
                handleType,
                disagreeHandleType
            });

            ViewBag.Extra       = extraStr;
            ViewBag.JSSDKConfig = sdkConfigStr;
            return(View());
        }
Beispiel #2
0
        public ActionResult <JssdkResult> GetJSSDK(string url)
        {
            //JSSDK 签名
            var handler = new JSSDKHandler();
            var result  = handler.GetSignature(url, corpId, appSecret);

            return(result);
        }
Beispiel #3
0
        public void Test_JSSDK_Valid()
        {
            var appService = container.Resolve <ICorpAppService>();
            var handler    = new JSSDKHandler(appService, Constants.MOBILE_APPROVAL);
            var url1       = @"http://meunsc.oicp.net/dev/ma/flowform/formdetail?id=a353688a-d3d8-e711-9708-8cdcd450dc4b&nodeid=797c409a-d3d8-e711-9708-8cdcd450dc4b&userId=bf632547-f432-e611-963d-c35f2f517ea0&nodeExtType=3&nodeExtGuid=6225e0c4-d85a-4dbd-8a18-43e898ce3755&src=/dev/MA/backlog/mybacklog";

            var url2 = @"http://meunsc.oicp.net/dev/ma/flowform/formdetail?id=a353688a-d3d8-e711-9708-8cdcd450dc4b&nodeid=797c409a-d3d8-e711-9708-8cdcd450dc4b&userId=bf632547-f432-e611-963d-c35f2f517ea0&nodeExtType=3&nodeExtGuid=6225e0c4-d85a-4dbd-8a18-43e898ce3755&src=/dev/MA/backlog/mybacklog";

            var result1 = handler.GetSignature(url1);

            var signature = JSSDKHelper.GetSignature(result1.JsapiTicket, result1.Noncestr, result1.Timestamp, url2);

            Assert.AreEqual(result1.Signature, signature);
        }
Beispiel #4
0
        /// <summary>
        /// 流程表单详情
        /// </summary>
        /// <param name="instanceId">流程实例ID</param>
        /// <param name="nodeId">节点ID</param>
        /// <param name="nodeExtId">节点扩展ID</param>
        /// <param name="nodeExtType">节点扩展类型 默认为原节点</param>
        /// <returns></returns>
        public ActionResult Detail(Guid instanceId, Guid?nodeId, Guid?nodeExtId, int nodeExtType = 0)
        {
            var currentUrl = Request.Url.ToString().Replace(":8070", "");
            //JSSDK 签名
            var handler      = new JSSDKHandler(_corpAppService, Constants.MOBILE_APPROVAL_TEST);
            var result       = handler.GetSignature(currentUrl);
            var sdkConfigStr = JsonHandler.ToJson(new
            {
                appId     = result.AppId,     // 必填,企业号的唯一标识,此处填写企业号corpid
                timestamp = result.Timestamp, // 必填,生成签名的时间戳
                nonceStr  = result.Noncestr,  // 必填,生成签名的随机串
                signature = result.Signature  // 必填,签名,见附录1
            });
            var model = InitMenus(instanceId);

            ViewBag.JSSDKConfig = sdkConfigStr;
            return(View(model));
        }
Beispiel #5
0
        public ActionResult BusinessHandlePage(string currentUrl = null)
        {
            currentUrl = currentUrl ?? Request.Url.ToString().Replace(":8070", "");
            //JSSDK 签名
            var handler = new JSSDKHandler(_corpAppService, Constants.MOBILE_APPROVAL_TEST);

            var result       = handler.GetSignature(currentUrl);
            var sdkConfigStr = JsonHandler.ToJson(new
            {
                appId     = result.AppId,     // 必填,企业号的唯一标识,此处填写企业号corpid
                timestamp = result.Timestamp, // 必填,生成签名的时间戳
                nonceStr  = result.Noncestr,  // 必填,生成签名的随机串
                signature = result.Signature  // 必填,签名,见附录1
            });

            ViewBag.JSSDKConfig = sdkConfigStr;
            return(View());
        }