zoukankan      html  css  js  c++  java
  • vue-admin-template测试模式和后端服务器联调

    默认是使用本地Mock,如何和后端服务联调?
    默认是development模式,env.development内容如下:

    # just a flag
    ENV = 'development'
    
    # base api
    VUE_APP_BASE_API = '/dev-api'
    
    # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
    # to control whether the babel-plugin-dynamic-import-node plugin is enabled.
    # It only does one thing by converting all import() to require().
    # This configuration can significantly increase the speed of hot updates,
    # when you have a large number of pages.
    # Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
    
    VUE_CLI_BABEL_TRANSPILE_MODULES = true

    只需要修改VUE_APP_BASE_API参数即可。

    比如我的本地后端服务器端口是8000,修改如下:

    VUE_APP_BASE_API = 'http://localhost:8000'
  • 相关阅读:
    HTTP协议简介
    Web开发中B/S架构和C/S架构的区别
    软件测试作业三
    Java8 时间处理
    Java EE
    Java 中的 I/O 抽象
    Python 高级 I/O 多路复用
    SQL 与关系代数
    Python 协程与事件循环
    Java SE 5.0
  • 原文地址:https://www.cnblogs.com/yoyotl/p/12275858.html
Copyright © 2011-2022 走看看