Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docker-compose.my.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
dockerfile: Dockerfile
image: ruoyi-frontend:latest
container_name: ruoyi-frontend
environment:
TZ: UTC
ports:
- "12580:80"
volumes:
Expand All @@ -22,6 +24,8 @@ services:
dockerfile: Dockerfile.my
image: ruoyi-backend-my:latest
container_name: ruoyi-backend-my
environment:
TZ: UTC
ports:
- "19099:9099"
depends_on:
Expand All @@ -37,6 +41,7 @@ services:
image: mysql:8.0
container_name: ruoyi-mysql
environment:
TZ: UTC
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ruoyi-fastapi
ports:
Expand All @@ -56,6 +61,8 @@ services:
ruoyi-redis:
image: redis:latest
container_name: ruoyi-redis
environment:
TZ: UTC
ports:
- "16379:6379"
networks:
Expand All @@ -70,4 +77,4 @@ services:
networks:
ruoyi-network:
name: ruoyi-network
driver: bridge
driver: bridge
9 changes: 8 additions & 1 deletion docker-compose.pg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
dockerfile: Dockerfile
image: ruoyi-frontend:latest
container_name: ruoyi-frontend
environment:
TZ: UTC
ports:
- "12580:80"
volumes:
Expand All @@ -22,6 +24,8 @@ services:
dockerfile: Dockerfile.pg
image: ruoyi-backend-pg:latest
container_name: ruoyi-backend-pg
environment:
TZ: UTC
ports:
- "19099:9099"
depends_on:
Expand All @@ -37,6 +41,7 @@ services:
image: postgres:14
container_name: ruoyi-pg
environment:
TZ: UTC
POSTGRES_PASSWORD: root
POSTGRES_DB: ruoyi-fastapi
POSTGRES_INITDB_ARGS: --encoding=UTF8 --lc-collate=C --lc-ctype=C
Expand All @@ -56,6 +61,8 @@ services:
ruoyi-redis:
image: redis:latest
container_name: ruoyi-redis
environment:
TZ: UTC
ports:
- "16379:6379"
networks:
Expand All @@ -70,4 +77,4 @@ services:
networks:
ruoyi-network:
name: ruoyi-network
driver: bridge
driver: bridge
18 changes: 12 additions & 6 deletions ruoyi-fastapi-app/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,22 @@ const config = {
],
],
plugins,
overrides: [
{
// @formatjs 的副作用入口没有 import/export,但所属包声明为 ESM。
// 保留模块语义,让 Babel 注入的辅助函数和 polyfill 由 webpack 正确打包。
test: /[/\\]node_modules[/\\]@formatjs[/\\]/,
sourceType: "module",
},
],
};

const UNI_H5_TEST = "**/@dcloudio/uni-h5/dist/index.umd.min.js";
if (process.env.NODE_ENV === "production") {
config.overrides = [
{
test: UNI_H5_TEST,
compact: true,
},
];
config.overrides.push({
test: UNI_H5_TEST,
compact: true,
});
} else {
config.ignore = [UNI_H5_TEST];
}
Expand Down
18 changes: 13 additions & 5 deletions ruoyi-fastapi-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@
"weapp:login": "weapp login",
"upload:dev": "weapp upload -p dist/dev/mp-weixin -v 1.0.0 -d \"dev version\"",
"upload:build": "weapp upload -p dist/build/mp-weixin -v 1.0.0 -d \"release version\"",
"postinstall": "weapp-tw patch",
"up:uni-app": "npx @dcloudio/uvm@latest"
"postinstall": "node scripts/patch-uni-webpack.cjs && weapp-tw patch",
"up:uni-app": "npx @dcloudio/uvm@latest",
"test:time": "node --test tests/time.test.mjs tests/time-polyfill.test.mjs tests/time-bundle.test.cjs"
},
"dependencies": {
"@dcloudio/uni-app": "2.0.2-4080720251210002",
Expand Down Expand Up @@ -78,7 +79,13 @@
"node-forge": "^1.4.0",
"regenerator-runtime": "^0.14.1",
"vue": "~2.6.14",
"vuex": "^3.2.0"
"vuex": "^3.2.0",
"@formatjs/intl-datetimeformat": "7.6.1",
"@formatjs/intl-getcanonicallocales": "3.2.11",
"@formatjs/intl-locale": "5.3.10",
"@formatjs/intl-numberformat": "9.4.0",
"@formatjs/intl-pluralrules": "6.3.13",
"dayjs": "1.11.23"
},
"devDependencies": {
"@babel/plugin-syntax-typescript": "^7.27.1",
Expand Down Expand Up @@ -113,9 +120,10 @@
"tailwindcss": "^3.4.19",
"tailwindcss-miniprogram-preset": "^2.0.0",
"typescript": "^5.9.3",
"vue-template-compiler": "^2.7.16",
"vue-template-compiler": "2.6.14",
"weapp-ide-cli": "^5.0.1",
"weapp-tailwindcss": "^4.9.8"
"weapp-tailwindcss": "^4.9.8",
"webpack": "5.110.3"
},
"browserslist": [
"Android >= 4",
Expand Down
19 changes: 19 additions & 0 deletions ruoyi-fastapi-app/scripts/patch-uni-webpack.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const fs = require('fs')

// 此 uni-app 版本即使关闭独立分包,也会预加载依赖 webpack 4 GraphHelpers
// 的插件。延迟到功能启用后再加载,保证 Vue CLI 5 的普通小程序构建可用。
const filename = require.resolve('@dcloudio/uni-mp-weixin/lib/createIndependentPlugin.js')
const source = fs.readFileSync(filename, 'utf8')
const marker = '// Lazy independent plugins for webpack 5'

if (!source.includes(marker)) {
const imports = source.match(/^const .+ = require\('.\/independent-plugins\/.+'\)\r?\n/gm)
const guard = 'if (!independentSwitch) return []'
if (!imports || !source.includes(guard)) {
throw new Error('uni-app 独立分包插件结构已变化,请检查 webpack 兼容补丁')
}
let patched = source
imports.forEach(line => { patched = patched.replace(line, '') })
patched = patched.replace(guard, `${guard}\n\n ${marker}\n${imports.map(line => ` ${line.trim()}`).join('\n')}`)
fs.writeFileSync(filename, patched)
}
136 changes: 70 additions & 66 deletions ruoyi-fastapi-app/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,66 +1,70 @@
<script>
import config from "./config";
import { getToken } from "@/utils/auth";

export default {
onLaunch: function () {
this.initApp();
},
methods: {
// 初始化应用
initApp() {
// 初始化应用配置
this.initConfig();
// 检查用户登录状态
//#ifdef H5
this.checkLogin();
//#endif
},
initConfig() {
this.globalData.config = config;
},
checkLogin() {
if (!getToken()) {
this.$tab.reLaunch("/pages/login");
}
},
},
};
</script>

<style>
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Global Reset for UniApp/Mobile */
page,
body {
height: 100%;
min-height: 100%;
overflow-x: hidden;
}

/* Global box-sizing for consistency with Tailwind preflight */
page,
view,
scroll-view,
image,
text,
button,
input,
textarea,
label,
navigator {
box-sizing: border-box;
}

/* Hide scrollbar for Chrome/Safari/Webkit */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
</style>
<script>
import { refreshDeviceTimezone } from "@/utils/time";
import config from "./config";
import { getToken } from "@/utils/auth";

export default {
onLaunch: function () {
this.initApp();
},
onShow() {
refreshDeviceTimezone();
},
methods: {
// 初始化应用
initApp() {
// 初始化应用配置
this.initConfig();
// 检查用户登录状态
//#ifdef H5
this.checkLogin();
//#endif
},
initConfig() {
this.globalData.config = config;
},
checkLogin() {
if (!getToken()) {
this.$tab.reLaunch("/pages/login");
}
},
},
};
</script>

<style>
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Global Reset for UniApp/Mobile */
page,
body {
height: 100%;
min-height: 100%;
overflow-x: hidden;
}

/* Global box-sizing for consistency with Tailwind preflight */
page,
view,
scroll-view,
image,
text,
button,
input,
textarea,
label,
navigator {
box-sizing: border-box;
}

/* Hide scrollbar for Chrome/Safari/Webkit */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
</style>
Loading
Loading