Giter Site home page Giter Site logo

Comments (1)

xiaojinzi123 avatar xiaojinzi123 commented on May 19, 2024

我个人觉得这个问题很好解决. 假如我们不考虑任何其他因素, 我们就考虑这个拦截器是属于哪一个 Module 的, 那相信你一定可以判断出来, 判断不出来的那些你可以放到 Base, 等到你想到了再转移都是 ok 的

既然你可以想清楚拦截器属于哪个模块, 那我是建议你把对应的拦截器放到对应的模块中. 反正 Component 框架也提供了跨组件使用其他模块的拦截器的功能.
比如登录拦截器、定位拦截器, 很多地方都会用到, 但是他们一个属于 User 模块, 一个属于(地图、Tools等等, 看你项目把这个功能归到哪个模块) 模块. 那你完全可以在各自的模块中去写, 这样子也更符合代码的边界的划分, 不会啥东西都往 base 上面放

from component.

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.