From 882cf6835e67cdc8bac8b913f4634d4a8b6406f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F=E4=B9=90?= Date: Wed, 8 Feb 2023 18:04:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=97=A5=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 1 + .env.production | 1 + package.json | 1 + src/App.vue | 3 + src/api/category.js | 7 +++ src/utils/request.js | 7 +++ .../main/components/navigation/index.vue | 10 ++++ .../components/navigation/mobile/index.vue | 16 ++++++ .../main/components/navigation/pc/index.vue | 7 +++ src/views/main/index.vue | 6 +- tailwind.config.cjs | 21 ++++--- vite.config.js | 9 +++ yarn.lock | 57 +++++++++++++++++++ 13 files changed, 134 insertions(+), 12 deletions(-) create mode 100644 .env.development create mode 100644 .env.production create mode 100644 src/api/category.js create mode 100644 src/utils/request.js create mode 100644 src/views/main/components/navigation/index.vue create mode 100644 src/views/main/components/navigation/mobile/index.vue create mode 100644 src/views/main/components/navigation/pc/index.vue diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..c6225c0 --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_BASE_API='http://www.qi36.com' \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..a2330be --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +VITE_BASE_API='https://www.echinacities.com' \ No newline at end of file diff --git a/package.json b/package.json index f8f924b..86f1bf8 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@vueuse/core": "^9.12.0", + "axios": "^1.3.2", "vue": "^3.2.45", "vue-router": "4" }, diff --git a/src/App.vue b/src/App.vue index 98240ae..5eddbf8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,3 +1,6 @@ + diff --git a/src/api/category.js b/src/api/category.js new file mode 100644 index 0000000..6e69542 --- /dev/null +++ b/src/api/category.js @@ -0,0 +1,7 @@ +import request from '@/utils/request.js' + +export const getCategory = () => { + return request({ + url: '/v1/ip' + }) +} diff --git a/src/utils/request.js b/src/utils/request.js new file mode 100644 index 0000000..f9e9a8f --- /dev/null +++ b/src/utils/request.js @@ -0,0 +1,7 @@ +import axios from 'axios' + +const service = axios.create({ + baseURL: `${import.meta.env.VITE_BASE_API}/api`, + timeout: 5000 +}) +export default service diff --git a/src/views/main/components/navigation/index.vue b/src/views/main/components/navigation/index.vue new file mode 100644 index 0000000..3a5f3ad --- /dev/null +++ b/src/views/main/components/navigation/index.vue @@ -0,0 +1,10 @@ + + + diff --git a/src/views/main/components/navigation/mobile/index.vue b/src/views/main/components/navigation/mobile/index.vue new file mode 100644 index 0000000..f1c82bd --- /dev/null +++ b/src/views/main/components/navigation/mobile/index.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/views/main/components/navigation/pc/index.vue b/src/views/main/components/navigation/pc/index.vue new file mode 100644 index 0000000..e1cba24 --- /dev/null +++ b/src/views/main/components/navigation/pc/index.vue @@ -0,0 +1,7 @@ + + + diff --git a/src/views/main/index.vue b/src/views/main/index.vue index a7af0a4..cbe34b3 100644 --- a/src/views/main/index.vue +++ b/src/views/main/index.vue @@ -1,3 +1,7 @@ + + diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 8385ae4..5a82ed1 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -1,12 +1,11 @@ -/** @type {import('tailwindcss').Config} */ +/** @type {import("tailwindcss").Config} */ module.exports = { - content: [ - "./index.html", - "./src/**/*.{vue,js,ts,jsx,tsx}", - ], - theme: { - extend: {}, - }, - plugins: [], - darkMode: false, -} + content: [ + "./index.html", + "./src/**/*.{vue,js,ts,jsx,tsx}" + ], + theme: { + extend: {} + }, + plugins: [] +}; diff --git a/vite.config.js b/vite.config.js index 15ad857..f2d5315 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,6 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import { join } from 'path' + // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], @@ -9,4 +10,12 @@ export default defineConfig({ '@': join(__dirname, '/src') } } + // server: { + // proxy: { + // '/api': { + // target: 'http://www.qi36.com', + // changeOrigin: true + // } + // } + // } }) diff --git a/yarn.lock b/yarn.lock index 07d6738..da5d916 100644 --- a/yarn.lock +++ b/yarn.lock @@ -297,6 +297,11 @@ arg@^5.0.2: resolved "https://registry.npmmirror.com/arg/-/arg-5.0.2.tgz" integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + autoprefixer@^10.4.13: version "10.4.13" resolved "https://registry.npmmirror.com/autoprefixer/-/autoprefixer-10.4.13.tgz" @@ -309,6 +314,15 @@ autoprefixer@^10.4.13: picocolors "^1.0.0" postcss-value-parser "^4.2.0" +axios@^1.3.2: + version "1.3.2" + resolved "https://registry.npmmirror.com/axios/-/axios-1.3.2.tgz#7ac517f0fa3ec46e0e636223fd973713a09c72b3" + integrity sha512-1M3O703bYqYuPhbHeya5bnhpYVsDDRyQSabNja04mZtboLNSuZ4YrltestrLXfHgmzua4TpUqRiVKbiQuo2epw== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.2.0.tgz" @@ -361,6 +375,13 @@ color-name@^1.1.4: resolved "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + cssesc@^3.0.0: version "3.0.0" resolved "https://registry.npmmirror.com/cssesc/-/cssesc-3.0.0.tgz" @@ -376,6 +397,11 @@ defined@^1.0.0: resolved "https://registry.npmmirror.com/defined/-/defined-1.0.1.tgz" integrity sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q== +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + detective@^5.2.1: version "5.2.1" resolved "https://registry.npmmirror.com/detective/-/detective-5.2.1.tgz" @@ -463,6 +489,20 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + fraction.js@^4.2.0: version "4.2.0" resolved "https://registry.npmmirror.com/fraction.js/-/fraction.js-4.2.0.tgz" @@ -560,6 +600,18 @@ micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + minimist@^1.2.6: version "1.2.7" resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.7.tgz" @@ -668,6 +720,11 @@ prettier@2.8.3: resolved "https://registry.npmmirror.com/prettier/-/prettier-2.8.3.tgz" integrity sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw== +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.npmmirror.com/queue-microtask/-/queue-microtask-1.2.3.tgz"