protected void Save_Btn_Click(object sender, EventArgs e)
 {
     if (Mid > 0)
     {
         infoMod = infoBll.SelReturnModel(Mid);
     }
     infoMod.Name      = Name_T.Text;
     infoMod.Flag      = Flag_T.Text;
     infoMod.APPID     = APPID_T.Text.Trim(' ');
     infoMod.APPKey    = APPKey_T.Text;
     infoMod.APPSecret = APPSecret_T.Text;
     infoMod.CallBack  = CallBack_T.Text;
     infoMod.UserName  = UserName_T.Text;
     infoMod.UserPwd   = UserPwd_T.Text;
     infoMod.Remind    = Remind_T.Text;
     if (Mid > 0)
     {
         infoBll.UpdateByID(infoMod);
     }
     else
     {
         infoBll.Insert(infoMod);
     }
     function.WriteSuccessMsg("操作完成", "PlatInfoList.aspx");
 }
示例#2
0
        public void Refresh()
        {
            M_Third_PlatInfo thirdMod = B_Third_PlatInfo.SelByFlag("点触");

            if (thirdMod != null)
            {
                PUBKEY = thirdMod.APPKey;
                PRIKEY = thirdMod.APPSecret;
            }
        }
示例#3
0
 //-----
 //private static Dictionary<int, string> TokenDir = new Dictionary<int, string>();
 //private string GetTokenByUid()
 //{
 //    M_AdminInfo adminMod = B_Admin.GetLogin();
 //    if (TokenDir.ContainsKey(adminMod.AdminId)) { return TokenDir[adminMod.AdminId]; }
 //    else { return ""; }
 //}
 //private void AddToken(string token)
 //{
 //    try
 //    {
 //        M_AdminInfo adminMod = B_Admin.GetLogin();
 //        if (TokenDir.ContainsKey(adminMod.AdminId))
 //        {
 //            TokenDir[adminMod.AdminId] = token;
 //        }
 //        else { TokenDir.Add(adminMod.AdminId, token); }
 //    }
 //    catch (Exception ex) { throw new Exception("AddToken,"+ex.Message); }
 //}
 //---------------------------------------------
 public static void CheckLogin()
 {
     if (string.IsNullOrEmpty(AccessToken))
     {
         C_CopyRight      crBll   = new C_CopyRight();
         M_Third_PlatInfo infoMod = B_Third_PlatInfo.SelByFlag("版权印");
         InfoCheck(infoMod);
         crBll.UserToToken(infoMod.UserName, infoMod.UserPwd);
         if (!string.IsNullOrEmpty(AccessToken))
         {
             HttpContext.Current.Response.Redirect(HttpContext.Current.Request.RawUrl);
         }
     }
 }
示例#4
0
 public C_CopyRight()
 {
     //Client_ID = "24165684208467970";
     //Client_Secret = "24165684208467971";
     if (string.IsNullOrEmpty(Client_ID))
     {
         M_Third_PlatInfo infoMod = B_Third_PlatInfo.SelByFlag("版权印");
         InfoCheck(infoMod);
         Client_ID     = infoMod.APPKey;
         Client_Secret = infoMod.APPSecret;
         if (string.IsNullOrEmpty(AccessToken))
         {
             UserToToken(infoMod.UserName, infoMod.UserPwd);
         }
     }
 }
示例#5
0
 private static void InfoCheck(M_Third_PlatInfo infoMod)
 {
     if (infoMod == null)
     {
         function.WriteErrMsg("未设置版权印信息,请先<a href='/" + SiteConfig.SiteOption.ManageDir + "/Config/PlatInfoList.aspx'>完成配置</a>");
     }
     else if (string.IsNullOrEmpty(infoMod.APPKey))
     {
         function.WriteErrMsg("未设置版权印Key,请先<a href='/" + SiteConfig.SiteOption.ManageDir + "/Config/PlatInfoList.aspx'>完成配置</a>");
     }
     else if (string.IsNullOrEmpty(infoMod.APPSecret))
     {
         function.WriteErrMsg("未设置版权印Secret,请先<a href='/" + SiteConfig.SiteOption.ManageDir + "/Config/PlatInfoList.aspx'>完成配置</a>");
     }
     else
     {
     }
 }
 private void MyBind()
 {
     if (Mid > 0)
     {
         infoMod = infoBll.SelReturnModel(Mid);
         if (infoMod == null)
         {
             function.WriteErrMsg("接口信息不存在");
         }
         Name_T.Text      = infoMod.Name;
         APPID_T.Text     = infoMod.APPID;
         Flag_T.Text      = infoMod.Flag;
         APPKey_T.Text    = infoMod.APPKey;
         APPSecret_T.Text = infoMod.APPSecret;
         CallBack_T.Text  = infoMod.CallBack;
         UserName_T.Text  = infoMod.UserName;
         //UserPwd_T.Text = infoMod.UserPwd;
         UserPwd_T.Attributes.Add("value", infoMod.UserPwd);
         Remind_T.Text = infoMod.Remind;
     }
 }
示例#7
0
        /// <summary>
        /// VideoCloud 构造方法
        /// </summary>
        /// <param name="timeOut">网络超时,默认60秒</param>
        public C_TencentMVS(int timeOut = 60)
        {
            this.timeOut = timeOut * 1000;
            M_Third_PlatInfo infoMod = B_Third_PlatInfo.SelByFlag("微视频");

            if (infoMod == null)
            {
                function.WriteErrMsg("未设置微视频信息,请先<a href='/" + SiteConfig.SiteOption.ManageDir + "/Config/PlatInfoList.aspx'>完成配置</a>");
            }
            appId     = DataConverter.CLng(infoMod.APPID);
            secretId  = infoMod.APPSecret;
            secretKey = infoMod.APPKey;

            //---发出请求测试是否key、id等是否正确
            string  result = GetFolderStat("", "");
            JObject obj    = JsonConvert.DeserializeObject <JObject>(result);

            if (!obj["code"].ToString().Equals("0"))
            {
                function.WriteErrMsg("微视频配置信息不正确,请先<a href='/" + SiteConfig.SiteOption.ManageDir + "/Config/PlatInfoList.aspx'>完成配置</a>");
            }
        }
示例#8
0
        public void ProcessRequest(HttpContext context)
        {
            M_AdminInfo adminMod = B_Admin.GetLogin();

            retMod.retcode = M_APIResult.Failed;
            //retMod.callback = CallBack;//暂不开放JsonP
            M_Third_PlatInfo infoMod = B_Third_PlatInfo.SelByFlag("版权印");

            if (infoMod == null || string.IsNullOrEmpty(infoMod.APPKey) || string.IsNullOrEmpty(infoMod.APPSecret))
            {
                retMod.retmsg = "未配置版权印接口"; RepToClient(retMod);
            }
            crAPI = new C_CopyRight();
            try
            {
                int gid = DataConvert.CLng(Req("gid"));
                switch (Action)
                {
                case "add":
                {
                    M_CommonData conMod = conBll.SelReturnModel(gid);
                    if (conMod == null)
                    {
                        retMod.retmsg = "未指定内容!"; break;
                    }
                    else
                    {
                        JObject obj = Add(conMod);
                        if (DataConvert.CLng(obj["value"]) == 1)
                        {
                            retMod.result  = obj["data"].ToString();
                            retMod.retcode = M_APIResult.Success;
                        }
                        else
                        {
                            retMod.retmsg = obj["msg"].ToString();
                        }
                    }
                }
                break;

                case "del":
                {
                    M_Content_CR crMod = crBll.SelByGid(gid);
                    if (crMod == null)
                    {
                        retMod.retmsg = "该内容未生成版权印"; break;
                    }
                    string  delResult = crAPI.Remove(crMod.WorksID);
                    JObject delObj    = JsonConvert.DeserializeObject <JObject>(delResult);
                    if (DataConvert.CLng(delObj["value"]) != 1)
                    {
                        retMod.retmsg = "删除失败,返回" + delResult;
                    }
                    else
                    {
                        crBll.Del(crMod.ID);
                        retMod.retcode = M_APIResult.Success;
                    }
                }
                break;

                case "readd":
                {
                    //删除
                    M_Content_CR crMod = crBll.SelByGid(gid);
                    if (crMod == null)
                    {
                        retMod.retmsg = "该内容未生成版权印"; break;
                    }
                    string  delResult = crAPI.Remove(crMod.WorksID);
                    JObject delObj    = JsonConvert.DeserializeObject <JObject>(delResult);
                    if (DataConvert.CLng(delObj["value"]) != 1)
                    {
                        retMod.retmsg = "删除失败,返回" + delResult; break;
                    }
                    else
                    {
                        crBll.Del(crMod.ID);
                    }
                    //重新添加
                    M_CommonData conMod = conBll.SelReturnModel(gid);
                    JObject      addObj = Add(conMod);
                    if (DataConvert.CLng(addObj["value"]) == 1)
                    {
                        retMod.result  = addObj["data"].ToString();
                        retMod.retcode = M_APIResult.Success;
                    }
                    else
                    {
                        retMod.retmsg = addObj["msg"].ToString();
                    }
                }
                break;

                case "get":
                {
                    M_Content_CR crMod = crBll.SelByGid(gid);
                    if (crMod != null)
                    {
                        retMod.retcode = M_APIResult.Success; retMod.result = JsonConvert.SerializeObject(crMod);
                    }
                }
                break;

                default:
                    retMod.retmsg = "[" + Action + "]接口不存在";
                    break;
                }
            }
            catch (Exception ex) { retMod.retmsg = ex.Message; }
            RepToClient(retMod);
        }