Giter VIP home page Giter VIP logo

Comments (12)

StarOfLife avatar StarOfLife commented on May 16, 2024 1

@johngcn 已经不会出现空白页面的问题了,非常感谢

from gf.

gqcn avatar gqcn commented on May 16, 2024

@StarOfLife 你好,请问你的 系统版本、系统架构、Go版本、框架版本,分别是什么?

from gf.

StarOfLife avatar StarOfLife commented on May 16, 2024

go version go1.11 windows/amd64
windows7 x64
框架版本v1.4.6

from gf.

gqcn avatar gqcn commented on May 16, 2024

@StarOfLife 好的,收到,我看看

from gf.

gqcn avatar gqcn commented on May 16, 2024

@StarOfLife 确认一下,出现空白页面的时候终端或者错误日志文件中是否有报错信息?例如:cannot find template file xxx之类的?

from gf.

StarOfLife avatar StarOfLife commented on May 16, 2024

@johngcn 没有错误信息,我发现两个

${.title}
放一起这种情况很容易出现白屏

from gf.

gqcn avatar gqcn commented on May 16, 2024

@StarOfLife 听你的描述似乎和模板内容解析有一定关系,你是用的哪个方法解析模板?

from gf.

StarOfLife avatar StarOfLife commented on May 16, 2024

用的是这种方式

content, _ := gins.View().Parse("login.html", map[string]interface{}{
		"title":     "登录",
		"publicKey": publicKey,
	})
	c.Response.Writeln(content)

from gf.

gqcn avatar gqcn commented on May 16, 2024

@StarOfLife 这种方式的话屏蔽了返回的错误信息,模板解析也有可能因为什么原因失败了,你改成c.Response.WriteTpl("login.html", map..,)这种方式试试,如果模板解析出错,会直接展示在页面上,便于定位问题。如果问题复现但是仍然找不到任何的错误输出,你@我。

from gf.

StarOfLife avatar StarOfLife commented on May 16, 2024

改成c.Response.WriteTpl("login.html", map..,)这种方式之后,模版页面当中多次添加删除元素,再次白屏,依旧没有错误输出。出现白屏时,模版当中处于下面结构,之后随意删除增加又能够重新渲染出来页面

            <input type="hidden" value="${.publicKey}" id="publicKey">
            <div>${.title}</div>
            <input type="hidden" value="${.publicKey}" id="publicKey">
            <input type="hidden" value="${.publicKey}" id="publicKey">
            <input type="hidden" value="${.publicKey}" id="publicKey">

from gf.

gqcn avatar gqcn commented on May 16, 2024

@StarOfLife 感谢反馈,那可能不是模板解析的问题,有可能是模板缓存造成的,我修复了一个版本,已提交,更新代码再试试。如果使用了go modules,由于本次的tagv1.4.6没有发生改变,你需要删除本地的缓存后再更新。查看version.go文件,如果版本号为v1.4.6.1则更新成功。如果还有问题,你@我。
wx20190131-135928 2x

from gf.

StarOfLife avatar StarOfLife commented on May 16, 2024

好的,非常感谢,祝新年快乐

from gf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.