GithubHelp home page GithubHelp logo

Comments (7)

iamoldli avatar iamoldli commented on July 28, 2024

说一下需求,为什么要在system.js里面增加属性~

from netmodular.

songjt123 avatar songjt123 commented on July 28, 2024

from netmodular.

iamoldli avatar iamoldli commented on July 28, 2024

还是没明白,你自己模块里面的api,为什么要放到system.js里面

from netmodular.

songjt123 avatar songjt123 commented on July 28, 2024

from netmodular.

songjt123 avatar songjt123 commented on July 28, 2024

from netmodular.

iamoldli avatar iamoldli commented on July 28, 2024

首先,不建议在system.js里面添加业务相关的功能。

其次,NetModular.UI是一个针对管理系统开发的框架,它本身不包含任何后端接口能力,而是提供了对应的配置能,如system中的actions,包含了管理系统所需的一些方法:

        /**系统的api方法 */
    actions: {
      /** 登录 */
      login: null,
      /** 获取验证码 */
      getVerifyCode: null,
      /**刷新令牌 */
      refreshToken: null,
      /**获取认证信息 */
      getAuthInfo: null,
      /** 修改密码 */
      updatePassword: null,
      /** 保存皮肤配置信息 */
      saveSkin: null
    }

NetModular.UI本身没有但是需要这些方法,所以需要在使用它的地方来配置,而NetModular则是在Admin模块中进行配置的。

如果你确实需要在system.js里面新增你的方法,可以试一下在你自己的模块的index.js的callback中配置,参考如下:

import './api'
import store from './store'
import routes from './routes'
import components from './components'
import module from './module'

export default {
  module,
  routes,
  store,
  components,
  callback({ store }) {
    store.state.app.system.actions.test = () => {
      console.log(1)
      //这里写你的逻辑
    }
  }
}

from netmodular.

songjt123 avatar songjt123 commented on July 28, 2024

from netmodular.

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.