/// <summary>加入内置变量</summary> private void AddBuildInVariables(IndexSubmissionConfig config, List <XmlVariable> variables) { AddBuildInVariable(variables, SubmissionConsts.ToolName, "本工具名称", PKSWebConsts.GetSubSystemCode()); AddBuildInVariable(variables, SubmissionConsts.Guid, "自动生成唯一值", string.Empty, new GuidValueProvider()); AddBuildInVariable(variables, SubmissionConsts.UserName, "用户名称", config.ApiService.UserName); AddBuildInVariable(variables, SubmissionConsts.WebApiUrl, "WebAPI站点URL", config.ApiService.Url); AddBuildInVariable(variables, SubmissionConsts.ProductFolder, "成果文件夹", config.Product.Folder); AddBuildInVariable(variables, SubmissionConsts.ExcelFileName, "Excel文件名", Path.GetFileNameWithoutExtension(config.Product.ExcelFile)); AddBuildInVariable(variables, SubmissionConsts.ShowType, "扩展名自动生成", string.Empty, new ExtToIndexDataTypeValueProvider()); AddBuildInVariable(variables, SubmissionConsts.ProductFileName, "成果文件名(无扩展名)", string.Empty, new FileNameValueProvider()); }
/// <summary>登录</summary> private bool Login() { this.ApiServiceConfig.LoginResult = null; var service = GetService <ISecurityServiceWrapper>(); var config = this.Config.ApiService; this.ApiServiceConfig.Config = config; var request = new LoginRequest(); request.AppCode = PKSWebConsts.GetSubSystemCode(); request.UserName = config.UserName; request.Password = config.Password; request.AuthenticationType = AuthenticationType.Forms; service.ResetServiceUrl(); var result = service.Login(request); if (result.Succeed) { this.ApiServiceConfig.LoginResult = result; return(true); } return(false); }
/// <summary>构造函数</summary> public PKSSubSystemLayoutRenderer() { //Lazy_Code = new Lazy<string>(() => Bootstrapper.Get<IPKSSubSystemConfig>().CurrentCode); this.Code = PKSWebConsts.GetSubSystemCode(); }