public AppBaseInfoHelper(string appkey) { _iAppBaseService = Himall.ServiceProvider.Instance <IAppBaseService> .Create; _AppKey = appkey; if (string.IsNullOrWhiteSpace(_AppKey)) { throw new HimallApiException(ApiErrorCode.Missing_App_Key, "app_key"); } _AppSecret = ""; try { _AppSecret = _iAppBaseService.GetAppSecret(_AppKey); } catch (Exception ex) { throw new HimallApiException(ApiErrorCode.Invalid_App_Key, "app_key"); } if (string.IsNullOrWhiteSpace(_AppSecret)) { throw new HimallApiException(ApiErrorCode.Insufficient_ISV_Permissions, "not set app_secreat"); } }
/// <summary> /// 通过appkey获取AppSecret /// </summary> /// <param name="appkey"></param> /// <returns></returns> public static string GetAppSecret(string appkey) { return(_iAppBaseService.GetAppSecret(appkey)); }