小编Ale*_*scu的帖子

如何在proxy.config.json文件中为angularcli项目设置代理头

我正在尝试设置代理标头angularcli.这是我目前在proxy.config.json文件中的内容:

"/api": {
    "target": "https://applications.str.coni.com/api",
    "secure": false,
    "logLevel": "debug"
Run Code Online (Sandbox Code Playgroud)

但到目前为止我没有运气,也许我错过了一些东西(可能在另一个文件中).任何建议将不胜感激.

proxy angular-cli

4
推荐指数
2
解决办法
6598
查看次数

如何将服务注入AutoMapper?

我正在使用AutoMapper将Entity映射到ViewModel。实体的属性之一是datetime。我想使用TimeZone将日期时间转换为本地日期时间。TimeZone存储在用户的会话对象中。我已经ISessionManager从用户会话中检索信息了。我不确定如何将ISessionManager注入AutoMapper

在下面的代码中,如何将ISessionManager.CurrentTimeZone属性传递给FromUTCToLocal()方法?

    public class SessionManager:ISessionManager
    {
       public TimeZoneInfo CurrentTimeZone
       {
          return (TimeZoneInfo)Session["CurrentTimeZone"];
       }
    }


    public static class DateTimeExtenstions
    {
        public static DateTime FromLocalToUTC(this DateTime dateTime, TimeZoneInfo timeZone)
        {
            // Here instead of taking timeZone as parameter i can
            // use servicelocator to get instance of ISessionManager
            // like var timeZone = ServiceLocator.GetInstance<ISessionManager>()
            // However i don't want to use servicelocator pattern since
            // everywhere else i am using IOC
            // also it doesnt make sense to …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc inversion-of-control unity-game-engine automapper

3
推荐指数
1
解决办法
848
查看次数

Google API Signout无效

我集成谷歌登录api和它工作正常但登出时出错.登出过程不起作用.登录用户点击退出链接功能后不会退出.这是我的代码:

<meta name="google-signin-client_id" content="here my api .apps.googleusercontent.com">
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<a href="javascript:signOut()">Sign Out</a>
<script>
function onSignIn(googleUser) {
    var profile = googleUser.getBasicProfile();
     if(profile.getEmail()!="") {
      var myKeyVals = { token : googleUser.getAuthResponse().id_token }
      $.ajax({
        type: "POST",
        url: "validate.php",
        data: myKeyVals,
        dataType: "text",
        success : function(data) {
            window.location = "page";
        }
      });
    }
  }

  function signOut() {
    var auth2 = gapi.auth2.getAuthInstance();
    auth2.signOut().then(function () {
    });
  }
</script>
Run Code Online (Sandbox Code Playgroud)

这里signOut js功能不起作用,页面将自动重新加载并转到adminpage. 这是我的文件.

提前致谢.

google-api google-login google-oauth

3
推荐指数
1
解决办法
4920
查看次数

使用 xsl fo 在 PDF 文档中创建超链接

我正在使用 xsl fo 和 Java 从 XML 生成 PDF。我需要在我的 6 列表的一列中嵌入一个超链接。这是我的代码片段。

    <fo:table-row>
    <xsl:for-each select="./clientMain/hierarchy/link">
    <fo:table-cell border="solid 1px black" text-align="left" font-size="10pt"><fo:block>Hierarchy</fo:block></fo:table-cell>
    <fo:table-cell border="solid 1px black" text-align="left" font-size="9pt">
    <fo:block><a>
    <xsl:attribute name="href"><xsl:value-of select="@link"/></xsl:attribute>
    </a></fo:block>
    <fo:block><xsl:value-of select="@link"/></fo:block></fo:table-cell>
    </xsl:for-each>
    </fo:table-row>
Run Code Online (Sandbox Code Playgroud)

但我的程序失败并出现此错误:

javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: "fo:table-row" is missing child elements. Required content model: (table-cell+) (No context info available)
    at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:718)
    at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2336)
    at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:682)
    at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2336)
    at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:682)
    at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2336)
Run Code Online (Sandbox Code Playgroud)

如果我评论这一行,一切正常。请帮忙 !!!!

xslt xsl-fo apache-fop

1
推荐指数
1
解决办法
4153
查看次数