Commit 34c09fcea82e3529519a5acc563a22adcd5faae1
1 parent
06e1d387
fix: repair local development post request proxy to https error problem (#63)
Showing
6 changed files
with
16 additions
and
9 deletions
.env.development
@@ -6,6 +6,7 @@ VITE_PUBLIC_PATH = / | @@ -6,6 +6,7 @@ VITE_PUBLIC_PATH = / | ||
6 | 6 | ||
7 | # Cross-domain proxy, you can configure multiple | 7 | # Cross-domain proxy, you can configure multiple |
8 | VITE_PROXY=[["/api","http://localhost:3000"]] | 8 | VITE_PROXY=[["/api","http://localhost:3000"]] |
9 | +# VITE_PROXY=[["/api","https://vvbin.cn/test"]] | ||
9 | 10 | ||
10 | # Delete console | 11 | # Delete console |
11 | VITE_DROP_CONSOLE = false | 12 | VITE_DROP_CONSOLE = false |
CHANGELOG.zh_CN.md
package.json
@@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
89 | "ts-node": "^9.0.0", | 89 | "ts-node": "^9.0.0", |
90 | "typescript": "^4.0.5", | 90 | "typescript": "^4.0.5", |
91 | "vite-plugin-html": "^1.0.0-beta.2", | 91 | "vite-plugin-html": "^1.0.0-beta.2", |
92 | - "vite-plugin-mock": "^1.0.4", | 92 | + "vite-plugin-mock": "^1.0.6", |
93 | "vite-plugin-purge-icons": "^0.4.4", | 93 | "vite-plugin-purge-icons": "^0.4.4", |
94 | "vite-plugin-pwa": "^0.1.2", | 94 | "vite-plugin-pwa": "^0.1.2", |
95 | "vue-eslint-parser": "^7.1.1", | 95 | "vue-eslint-parser": "^7.1.1", |
src/App.vue
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | moment.locale('zh-cn'); | 20 | moment.locale('zh-cn'); |
21 | 21 | ||
22 | export default defineComponent({ | 22 | export default defineComponent({ |
23 | - name: 'App1', | 23 | + name: 'App', |
24 | components: { ConfigProvider }, | 24 | components: { ConfigProvider }, |
25 | setup() { | 25 | setup() { |
26 | useInitAppConfigStore(); | 26 | useInitAppConfigStore(); |
src/utils/http/axios/index.ts
@@ -116,20 +116,20 @@ const transform: AxiosTransform = { | @@ -116,20 +116,20 @@ const transform: AxiosTransform = { | ||
116 | } else { | 116 | } else { |
117 | // 兼容restful风格 | 117 | // 兼容restful风格 |
118 | config.url = config.url + config.params + `?_t=${now}`; | 118 | config.url = config.url + config.params + `?_t=${now}`; |
119 | - config.params = {}; | 119 | + config.params = undefined; |
120 | } | 120 | } |
121 | } else { | 121 | } else { |
122 | if (!isString(config.params)) { | 122 | if (!isString(config.params)) { |
123 | formatDate && formatRequestDate(config.params); | 123 | formatDate && formatRequestDate(config.params); |
124 | config.data = config.params; | 124 | config.data = config.params; |
125 | - config.params = {}; | 125 | + config.params = undefined; |
126 | if (joinParamsToUrl) { | 126 | if (joinParamsToUrl) { |
127 | config.url = setObjToUrlParams(config.url as string, config.data); | 127 | config.url = setObjToUrlParams(config.url as string, config.data); |
128 | } | 128 | } |
129 | } else { | 129 | } else { |
130 | // 兼容restful风格 | 130 | // 兼容restful风格 |
131 | config.url = config.url + config.params; | 131 | config.url = config.url + config.params; |
132 | - config.params = {}; | 132 | + config.params = undefined; |
133 | } | 133 | } |
134 | } | 134 | } |
135 | return config; | 135 | return config; |
yarn.lock
@@ -7993,10 +7993,10 @@ vite-plugin-html@^1.0.0-beta.2: | @@ -7993,10 +7993,10 @@ vite-plugin-html@^1.0.0-beta.2: | ||
7993 | html-minifier-terser "^5.1.1" | 7993 | html-minifier-terser "^5.1.1" |
7994 | lodash "^4.17.20" | 7994 | lodash "^4.17.20" |
7995 | 7995 | ||
7996 | -vite-plugin-mock@^1.0.4: | ||
7997 | - version "1.0.4" | ||
7998 | - resolved "https://registry.npmjs.org/vite-plugin-mock/-/vite-plugin-mock-1.0.4.tgz#56631559afcd77046b058f162b2b5e8f5aaa7b17" | ||
7999 | - integrity sha512-jtos6ri0GAE/abv9VQyVvpPF5yQZaFx7vB7GV9wAZ5TQWqzH9nKUdmVj9ret7lC/oCnpaZn+2twxh4qzkVsd5Q== | 7996 | +vite-plugin-mock@^1.0.6: |
7997 | + version "1.0.6" | ||
7998 | + resolved "https://registry.npmjs.org/vite-plugin-mock/-/vite-plugin-mock-1.0.6.tgz#4f47f193fd48a02c66641fc7242bd5329f99b471" | ||
7999 | + integrity sha512-+IeCiZBgQt2BpKKzYwoB5bWrrUwiksQh/9zWUrsegGw14PXmXtXXmgHr3CkKjyIChZmvuBs1BPieHD8SyBQAGQ== | ||
8000 | dependencies: | 8000 | dependencies: |
8001 | "@rollup/plugin-node-resolve" "^9.0.0" | 8001 | "@rollup/plugin-node-resolve" "^9.0.0" |
8002 | chalk "^4.1.0" | 8002 | chalk "^4.1.0" |