Git Product home page Git Product logo

Comments (4)

sci2sci avatar sci2sci commented on September 18, 2024

我想设计一个博客文章只显示简介 或者部分。后面遮盖,然后需要继续阅读按钮 如果点击继续阅读按钮现实后请先登录或者注册 这个怎么实现啊。

from blogin.

weijiang1994 avatar weijiang1994 commented on September 18, 2024

自己思考一下。

from blogin.

sci2sci avatar sci2sci commented on September 18, 2024

好吧 能否提示参考代码吗

from blogin.

weijiang1994 avatar weijiang1994 commented on September 18, 2024

有两种实现方式

  1. 在前端隐藏博客内容,可以将显示博客内容的div盒子高度设置为固定,然后关闭overflow-y,当用户点击继续阅读的时候,可以先判断是否登录,如果登录了,则显示没有登录则跳转到登录页面,不过这种方式懂前端的人很容易破解;
  2. 在后端做限制,当用户未登录的时候,只返回一部分内容,但是由于博客内容是保存的HTML文本,因此需要考虑到截取的时破坏HTML标签的问题;

from blogin.

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.