沈丘营商办后台前端项目
王恒
2025-08-06 860406f6cb16c77621a5f583a5214f9f3e370eb0
'更换域名'
5个文件已修改
19 ■■■■■ 已修改文件
.env.production 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.production
@@ -5,10 +5,11 @@
VITE_APP_ENV = 'production'
#基础域名
VITE_APP_BASE = 'https://jmy.jinmingyuan.com'
# VITE_APP_BASE = 'https://cxsm.jinmingyuan.com'
VITE_APP_BASE = 'http://36.108.168.12:9000'
# 入企扫码/生产环境
VITE_APP_BASE_API = '/sqys-prod-api'
VITE_APP_BASE_API = '/smrq-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip
.gitignore
@@ -1,6 +1,7 @@
.DS_Store
node_modules/
ctomsWeb/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
src/layout/components/Navbar.vue
@@ -99,7 +99,8 @@
  })
    .then(() => {
      userStore.logOut().then(() => {
        location.href = "/sqys-web/index";
        // location.href = "/sqys-web/index";
        location.href = "/smrq/index";
      });
    })
    .catch(() => {});
src/router/index.ts
@@ -166,7 +166,8 @@
];
const router = createRouter({
  history: createWebHistory("/sqys-web/"),
  // history: createWebHistory("/sqys-web/"),
  history: createWebHistory("/smrq/"),
  routes: constantRoutes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
vite.config.ts
@@ -9,7 +9,8 @@
    // 部署生产环境和开发环境下的URL。
    // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
    // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
    base: VITE_APP_ENV === "production" ? "/sqys-web/" : "/",
    // 测试环境 sqys-web  正式环境 smrq
    base: VITE_APP_ENV === "production" ? "/smrq/" : "/",
    plugins: [...createVitePlugins(env, command === "build")],
    resolve: {
      // https://cn.vitejs.dev/config/#resolve-alias
@@ -32,10 +33,10 @@
          changeOrigin: true,
          rewrite: (p) => p.replace(/^\/dev-api/, ""),
        },
        "/sqys-prod-api": {
        "/smrq-api": {
          target: VITE_APP_BASE,
          changeOrigin: true,
          rewrite: (p) => p.replace(/^\/sqys-prod-api/, ""),
          rewrite: (p) => p.replace(/^\/smrq-api/, ""),
        },
      },
      port: 81,