车辆管理系统-后台管理系统web
spring
4 天以前 9a11bff3d98aea29f37abc34a00a17f5c92ade9c
fix: 扫码路径ip修改
已修改4个文件
40 ■■■■ 文件已修改
src/utils/settingMer.js 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/vehicle/queuing/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/vehicle/registration/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/settingMer.js
@@ -8,16 +8,36 @@
// | Author: CMS Team <admin@CMS.com>
// +----------------------------------------------------------------------
// 请求接口地址 如果没有配置自动获取当前网址路径
const VUE_APP_API_URL = process.env.VUE_APP_BASE_API || `${location.origin}`
const VUE_APP_WS_URL = process.env.VUE_APP_WS_URL || (location.protocol === 'https' ? 'wss' : 'ws') + ':' + location.hostname
// 请求接口地址
// 说明:生产环境下不希望使用“当前前端端口”,而应直接走后端端口 9031。
const DEFAULT_API_PORT = process.env.VUE_APP_API_PORT || 9031;
const VUE_APP_API_URL =
  process.env.VUE_APP_BASE_API ||
  (typeof location !== "undefined"
    ? `${location.protocol}//${location.hostname}:${DEFAULT_API_PORT}`
    : `http://127.0.0.1:${DEFAULT_API_PORT}`);
// 支持用户传入的 VUE_APP_BASE_API 已经包含 /api 的情况,避免拼成双 /api
const apiBaseURL = VUE_APP_API_URL.includes("/api")
  ? VUE_APP_API_URL.endsWith("/") ? VUE_APP_API_URL : `${VUE_APP_API_URL}/`
  : `${VUE_APP_API_URL.replace(/\/+$/, "")}/api/`;
const VUE_APP_WS_URL =
  process.env.VUE_APP_WS_URL ||
  (typeof location !== "undefined"
    ? `${
        location.protocol === "https" ? "wss" : "ws"
      }://${location.hostname}:${DEFAULT_API_PORT}`
    : `ws://127.0.0.1:${DEFAULT_API_PORT}`);
const SettingMer = {
  // 服务器地址
  httpUrl: VUE_APP_API_URL,
  // 接口请求地址
  apiBaseURL: VUE_APP_API_URL + '/api/',
  apiBaseURL,
  // socket连接
  wsSocketUrl: VUE_APP_WS_URL
}
  wsSocketUrl: VUE_APP_WS_URL,
};
export default SettingMer
src/views/vehicle/queuing/index.vue
@@ -554,7 +554,7 @@
        newEl.registerTime = res.registerTime || "-";
        newEl.remark = res.remark || "-";
        // newEl.url = `https://car-manager.truekey.mobi/driver/javaMobile/queryResult/${res.linkCode}`;
        newEl.url = `http://1.15.17.182:9031/driver/javaMobile/queryResult/${res.linkCode}`;
        newEl.url = `http://1.15.17.182:9033/driver/javaMobile/queryResult/${res.linkCode}`;
        newEl.visible = true;
        setTimeout(() => {
src/views/vehicle/registration/index.vue
@@ -725,7 +725,7 @@
        newEl.registerTime = element.registerTime || "-";
        newEl.remark = element.remark || "-";
        // newEl.url = `https://car-manager.truekey.mobi/driver/javaMobile/queryResult/${element.linkCode}`;
         newEl.url = `http://1.15.17.182:9031/driver/javaMobile/queryResult/${element.linkCode}`;
         newEl.url = `http://1.15.17.182:9033/driver/javaMobile/queryResult/${element.linkCode}`;
        newEl.visible = true;
        printArr.push(newEl);
      }
vue.config.js
@@ -35,7 +35,9 @@
    "@babel",
    "resize-detector",
  ],
  publicPath: "/",
  // 部署到子路径时需要改 publicPath,否则静态资源会从域名根目录 `/static/...` 获取失败
  // 例如部署到 `http://host/car-before/`,则打包时设置 VUE_APP_PUBLIC_PATH=/car-before/
  publicPath: process.env.VUE_APP_PUBLIC_PATH || "/",
  outputDir: "dist",
  assetsDir: "static",
  // 在部分环境下 eslint-loader 会因配置解析失败直接导致构建中断