From 557a3d316e2597d7142d0560d37c071f10e0d2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=8D=E7=BC=96=E8=AF=91=E5=B7=A5=E4=BD=9C=E5=8C=BA?= Date: Wed, 29 Apr 2026 13:04:05 +0800 Subject: [PATCH] feat: scaffold front_acs Vue 2 project Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus Former-commit-id: 7216db7bb08a06b77041cd9f9c4245bcaa858c81 --- .../projects/front_acs/babel.config.js | 3 +++ .../projects/front_acs/package.json | 24 +++++++++++++++++++ .../projects/front_acs/public/index.html | 13 ++++++++++ .../projects/front_acs/src/App.vue | 17 +++++++++++++ .../projects/front_acs/src/api/index.js | 17 +++++++++++++ .../front_acs/src/components/.gitkeep | 1 + .../projects/front_acs/src/main.js | 17 +++++++++++++ .../projects/front_acs/src/router/index.js | 15 ++++++++++++ .../projects/front_acs/src/store/index.js | 11 +++++++++ .../projects/front_acs/src/views/.gitkeep | 1 + .../projects/front_acs/vue.config.js | 15 ++++++++++++ 11 files changed, 134 insertions(+) create mode 100644 frontend-source/projects/front_acs/babel.config.js create mode 100644 frontend-source/projects/front_acs/package.json create mode 100644 frontend-source/projects/front_acs/public/index.html create mode 100644 frontend-source/projects/front_acs/src/App.vue create mode 100644 frontend-source/projects/front_acs/src/api/index.js create mode 100644 frontend-source/projects/front_acs/src/components/.gitkeep create mode 100644 frontend-source/projects/front_acs/src/main.js create mode 100644 frontend-source/projects/front_acs/src/router/index.js create mode 100644 frontend-source/projects/front_acs/src/store/index.js create mode 100644 frontend-source/projects/front_acs/src/views/.gitkeep create mode 100644 frontend-source/projects/front_acs/vue.config.js diff --git a/frontend-source/projects/front_acs/babel.config.js b/frontend-source/projects/front_acs/babel.config.js new file mode 100644 index 00000000..078c0056 --- /dev/null +++ b/frontend-source/projects/front_acs/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ['@vue/cli-plugin-babel/preset'], +}; diff --git a/frontend-source/projects/front_acs/package.json b/frontend-source/projects/front_acs/package.json new file mode 100644 index 00000000..ffa30576 --- /dev/null +++ b/frontend-source/projects/front_acs/package.json @@ -0,0 +1,24 @@ +{ + "name": "front_acs", + "version": "1.0.0", + "private": true, + "scripts": { + "dev": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "axios": "^0.21.4", + "element-ui": "^2.15.14", + "vue": "^2.6.14", + "vue-router": "^3.5.3", + "vuex": "^3.6.2" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^4.5.19", + "@vue/cli-plugin-router": "^4.5.19", + "@vue/cli-plugin-vuex": "^4.5.19", + "@vue/cli-service": "^4.5.19", + "vue-template-compiler": "^2.6.14" + } +} diff --git a/frontend-source/projects/front_acs/public/index.html b/frontend-source/projects/front_acs/public/index.html new file mode 100644 index 00000000..e5c0e14a --- /dev/null +++ b/frontend-source/projects/front_acs/public/index.html @@ -0,0 +1,13 @@ + + + + + + + + 门禁管理系统 + + +
+ + diff --git a/frontend-source/projects/front_acs/src/App.vue b/frontend-source/projects/front_acs/src/App.vue new file mode 100644 index 00000000..ea119b7c --- /dev/null +++ b/frontend-source/projects/front_acs/src/App.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/frontend-source/projects/front_acs/src/api/index.js b/frontend-source/projects/front_acs/src/api/index.js new file mode 100644 index 00000000..e2c6c009 --- /dev/null +++ b/frontend-source/projects/front_acs/src/api/index.js @@ -0,0 +1,17 @@ +import axios from 'axios'; + +const api = axios.create({ + baseURL: '/api', + timeout: 30000, +}); + +api.interceptors.request.use((config) => { + return config; +}); + +api.interceptors.response.use( + (response) => response.data, + (error) => Promise.reject(error) +); + +export default api; diff --git a/frontend-source/projects/front_acs/src/components/.gitkeep b/frontend-source/projects/front_acs/src/components/.gitkeep new file mode 100644 index 00000000..8d1c8b69 --- /dev/null +++ b/frontend-source/projects/front_acs/src/components/.gitkeep @@ -0,0 +1 @@ + diff --git a/frontend-source/projects/front_acs/src/main.js b/frontend-source/projects/front_acs/src/main.js new file mode 100644 index 00000000..b4b78460 --- /dev/null +++ b/frontend-source/projects/front_acs/src/main.js @@ -0,0 +1,17 @@ +import Vue from 'vue'; +import ElementUI from 'element-ui'; +import 'element-ui/lib/theme-chalk/index.css'; +import App from './App.vue'; +import router from './router'; +import store from './store'; +import axios from 'axios'; + +Vue.use(ElementUI); +Vue.prototype.$http = axios; +Vue.config.productionTip = false; + +new Vue({ + router, + store, + render: (h) => h(App), +}).$mount('#app'); diff --git a/frontend-source/projects/front_acs/src/router/index.js b/frontend-source/projects/front_acs/src/router/index.js new file mode 100644 index 00000000..8b2eda6a --- /dev/null +++ b/frontend-source/projects/front_acs/src/router/index.js @@ -0,0 +1,15 @@ +import Vue from 'vue'; +import VueRouter from 'vue-router'; + +Vue.use(VueRouter); + +// 路由从 decompiled/cwos-portal/router-tree.md 提取后填入 +// 示例: { path: '/dashboard', name: 'Dashboard', component: () => import('@/views/Dashboard.vue') } +const routes = []; + +const router = new VueRouter({ + mode: 'hash', + routes, +}); + +export default router; diff --git a/frontend-source/projects/front_acs/src/store/index.js b/frontend-source/projects/front_acs/src/store/index.js new file mode 100644 index 00000000..3431aaad --- /dev/null +++ b/frontend-source/projects/front_acs/src/store/index.js @@ -0,0 +1,11 @@ +import Vue from 'vue'; +import Vuex from 'vuex'; + +Vue.use(Vuex); + +export default new Vuex.Store({ + state: {}, + mutations: {}, + actions: {}, + modules: {}, +}); diff --git a/frontend-source/projects/front_acs/src/views/.gitkeep b/frontend-source/projects/front_acs/src/views/.gitkeep new file mode 100644 index 00000000..8d1c8b69 --- /dev/null +++ b/frontend-source/projects/front_acs/src/views/.gitkeep @@ -0,0 +1 @@ + diff --git a/frontend-source/projects/front_acs/vue.config.js b/frontend-source/projects/front_acs/vue.config.js new file mode 100644 index 00000000..85d9a7a6 --- /dev/null +++ b/frontend-source/projects/front_acs/vue.config.js @@ -0,0 +1,15 @@ +module.exports = { + publicPath: './', + outputDir: 'dist', + assetsDir: 'static', + productionSourceMap: false, + devServer: { + port: 8080, + proxy: { + '/api': { + target: 'http://localhost:8090', + changeOrigin: true, + }, + }, + }, +};