Przeglądaj źródła

公用信息整理

guhongwei 2 lat temu
rodzic
commit
16ac2bbf50
11 zmienionych plików z 42 dodań i 91 usunięć
  1. 3 3
      .env.development
  2. 3 3
      .env.production
  3. 3 8
      .eslintrc.cjs
  4. 1 0
      .gitignore
  5. 1 46
      README.md
  6. 2 2
      env.d.ts
  7. 1 1
      package.json
  8. 9 9
      src/main.ts
  9. 3 3
      src/router/index.ts
  10. 7 7
      src/stores/counter.ts
  11. 9 9
      vite.config.ts

+ 3 - 3
.env.development

@@ -1,6 +1,6 @@
-VITE_BASE_URL = "/liveadmin"
-VITE_OUT_DIR = "liveadmin"
+VITE_BASE_URL = "/zkzxadmin"
+VITE_OUT_DIR = "zkzxadmin"
 VITE_REQUEST_BASE = ''
 VITE_REQUEST_BASE = ''
 VITE_APP_HOST="http://broadcast.waityou24.cn"
 VITE_APP_HOST="http://broadcast.waityou24.cn"
 VITE_APP_PAGE_SIZE=10
 VITE_APP_PAGE_SIZE=10
-VITE_APP_ROUTER="liveadmin"
+VITE_APP_ROUTER="zkzxadmin"

+ 3 - 3
.env.production

@@ -1,6 +1,6 @@
-VITE_BASE_URL = "/liveadmin"
-VITE_OUT_DIR = "liveadmin"
+VITE_BASE_URL = "/zkzxadmin"
+VITE_OUT_DIR = "zkzxadmin"
 VITE_REQUEST_BASE = ''
 VITE_REQUEST_BASE = ''
 VITE_APP_HOST="http://broadcast.waityou24.cn"
 VITE_APP_HOST="http://broadcast.waityou24.cn"
 VITE_APP_PAGE_SIZE=10
 VITE_APP_PAGE_SIZE=10
-VITE_APP_ROUTER="liveadmin"
+VITE_APP_ROUTER="zkzxadmin"

+ 3 - 8
.eslintrc.cjs

@@ -1,14 +1,9 @@
 /* eslint-env node */
 /* eslint-env node */
-require('@rushstack/eslint-patch/modern-module-resolution')
+require('@rushstack/eslint-patch/modern-module-resolution');
 
 
 module.exports = {
 module.exports = {
   root: true,
   root: true,
-  extends: [
-    'plugin:vue/vue3-essential',
-    'eslint:recommended',
-    '@vue/eslint-config-typescript',
-    '@vue/eslint-config-prettier'
-  ],
+  extends: ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/eslint-config-typescript', '@vue/eslint-config-prettier'],
   parserOptions: {
   parserOptions: {
     ecmaVersion: 'latest'
     ecmaVersion: 'latest'
   },
   },
@@ -30,4 +25,4 @@ module.exports = {
       }
       }
     ]
     ]
   }
   }
-}
+};

+ 1 - 0
.gitignore

@@ -26,3 +26,4 @@ coverage
 *.njsproj
 *.njsproj
 *.sln
 *.sln
 *.sw?
 *.sw?
+*.history

+ 1 - 46
README.md

@@ -1,46 +1 @@
-# zkzx_admin
-
-This template should help get you started developing with Vue 3 in Vite.
-
-## Recommended IDE Setup
-
-[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
-
-## Type Support for `.vue` Imports in TS
-
-TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
-
-If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
-
-1. Disable the built-in TypeScript Extension
-    1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
-    2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
-2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
-
-## Customize configuration
-
-See [Vite Configuration Reference](https://vitejs.dev/config/).
-
-## Project Setup
-
-```sh
-npm install
-```
-
-### Compile and Hot-Reload for Development
-
-```sh
-npm run dev
-```
-
-### Type-Check, Compile and Minify for Production
-
-```sh
-npm run build
-```
-
-### Lint with [ESLint](https://eslint.org/)
-
-```sh
-npm run lint
-```
+zkzx_admin

+ 2 - 2
env.d.ts

@@ -1,5 +1,5 @@
 /// <reference types="vite/client" />
 /// <reference types="vite/client" />
 interface ImportMetaEnv {
 interface ImportMetaEnv {
-  VITE_BASE_URL: string
-  VITE_OUT_DIR: string
+  VITE_BASE_URL: string;
+  VITE_OUT_DIR: string;
 }
 }

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "version": "0.0.0",
   "version": "0.0.0",
   "private": true,
   "private": true,
   "scripts": {
   "scripts": {
-    "dev": "vite",
+    "dev": "vite  --host",
     "build": "run-p type-check build-only",
     "build": "run-p type-check build-only",
     "preview": "vite preview",
     "preview": "vite preview",
     "build-only": "vite build",
     "build-only": "vite build",

+ 9 - 9
src/main.ts

@@ -1,14 +1,14 @@
-import { createApp } from 'vue'
-import { createPinia } from 'pinia'
+import { createApp } from 'vue';
+import { createPinia } from 'pinia';
 
 
-import App from './App.vue'
-import router from './router'
+import App from './App.vue';
+import router from './router';
 
 
-import './assets/main.css'
+import './assets/main.css';
 
 
-const app = createApp(App)
+const app = createApp(App);
 
 
-app.use(createPinia())
-app.use(router)
+app.use(createPinia());
+app.use(router);
 
 
-app.mount('#app')
+app.mount('#app');

+ 3 - 3
src/router/index.ts

@@ -1,4 +1,4 @@
-import { createRouter, createWebHistory } from 'vue-router'
+import { createRouter, createWebHistory } from 'vue-router';
 
 
 const router = createRouter({
 const router = createRouter({
   history: createWebHistory(import.meta.env.BASE_URL),
   history: createWebHistory(import.meta.env.BASE_URL),
@@ -9,6 +9,6 @@ const router = createRouter({
       component: () => import('../views/home/index.vue')
       component: () => import('../views/home/index.vue')
     }
     }
   ]
   ]
-})
+});
 
 
-export default router
+export default router;

+ 7 - 7
src/stores/counter.ts

@@ -1,12 +1,12 @@
-import { ref, computed } from 'vue'
-import { defineStore } from 'pinia'
+import { ref, computed } from 'vue';
+import { defineStore } from 'pinia';
 
 
 export const useCounterStore = defineStore('counter', () => {
 export const useCounterStore = defineStore('counter', () => {
-  const count = ref(0)
-  const doubleCount = computed(() => count.value * 2)
+  const count = ref(0);
+  const doubleCount = computed(() => count.value * 2);
   function increment() {
   function increment() {
-    count.value++
+    count.value++;
   }
   }
 
 
-  return { count, doubleCount, increment }
-})
+  return { count, doubleCount, increment };
+});

+ 9 - 9
vite.config.ts

@@ -1,10 +1,10 @@
-import { fileURLToPath, URL } from 'node:url'
-import { defineConfig, loadEnv } from 'vite'
-import vue from '@vitejs/plugin-vue'
-const path = require('path')
-const common = path.resolve(__dirname, '../common')
+import { fileURLToPath, URL } from 'node:url';
+import { defineConfig, loadEnv } from 'vite';
+import vue from '@vitejs/plugin-vue';
+const path = require('path');
+const common = path.resolve(__dirname, '../common');
 export default defineConfig(({ mode }) => {
 export default defineConfig(({ mode }) => {
-  const env = loadEnv(mode, __dirname)
+  const env = loadEnv(mode, __dirname);
   return {
   return {
     // 静态路径
     // 静态路径
     base: env.VITE_BASE_URL,
     base: env.VITE_BASE_URL,
@@ -14,7 +14,7 @@ export default defineConfig(({ mode }) => {
     },
     },
     plugins: [vue()],
     plugins: [vue()],
     server: {
     server: {
-      port: 8001,
+      port: 8003,
       proxy: {
       proxy: {
         '/files': {
         '/files': {
           target: 'http://basic.waityou24.cn'
           target: 'http://basic.waityou24.cn'
@@ -28,5 +28,5 @@ export default defineConfig(({ mode }) => {
         '@common': common
         '@common': common
       }
       }
     }
     }
-  }
-})
+  };
+});