gc_i18n 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/gc_i18n.css +1 -1
- package/lib/gc_i18n.js +1206 -1219
- package/lib/gc_i18n.umd.cjs +10 -10
- package/package.json +1 -1
- package/packages/components/config.vue +21 -21
- package/packages/index.js +0 -1
- package/src/router/index.js +0 -5
- package/vite.config.js +6 -2
- package/packages/libs/http.js +0 -64
- package/src/view/test.vue +0 -7
package/packages/libs/http.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as Vue from "vue";
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
import { Message } from "view-ui-plus";
|
|
4
|
-
import * as _ from "lodash-es";
|
|
5
|
-
// Vue.prototype.$http = axios;
|
|
6
|
-
|
|
7
|
-
Message.config({
|
|
8
|
-
duration: 3
|
|
9
|
-
});
|
|
10
|
-
axios.defaults.timeout = 60000;
|
|
11
|
-
|
|
12
|
-
axios.interceptors.request.use(
|
|
13
|
-
(config) => {
|
|
14
|
-
config.headers["Content-Type"] = "application/json";
|
|
15
|
-
return config;
|
|
16
|
-
},
|
|
17
|
-
(err) => {
|
|
18
|
-
Message.error({
|
|
19
|
-
content: "请求超时!"
|
|
20
|
-
});
|
|
21
|
-
return Promise.resolve(err);
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
axios.interceptors.response.use(
|
|
25
|
-
(res) => {
|
|
26
|
-
const { nomsg } = res.config.headers;
|
|
27
|
-
if (res.status && res.status != 200) {
|
|
28
|
-
if (!nomsg) {
|
|
29
|
-
Message.error({
|
|
30
|
-
content: res.data.message || "未知错误"
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
res.data.success = true;
|
|
35
|
-
}
|
|
36
|
-
return res;
|
|
37
|
-
},
|
|
38
|
-
(err) => {
|
|
39
|
-
if (err.response) {
|
|
40
|
-
if (err.response.status == 504 || err.response.status == 404) {
|
|
41
|
-
Message.error({ content: "服务器被吃了⊙﹏⊙∥" });
|
|
42
|
-
} else if (err.response.status == 403) {
|
|
43
|
-
Message.error({ content: "权限不足,请联系管理员!" });
|
|
44
|
-
} else
|
|
45
|
-
Message.error({
|
|
46
|
-
content: `${err.response.status}:${
|
|
47
|
-
err.response.statusText || err.response.error
|
|
48
|
-
}`
|
|
49
|
-
});
|
|
50
|
-
} else if (
|
|
51
|
-
err.code === "ECONNABORTED" &&
|
|
52
|
-
err.message.indexOf("timeout") !== -1
|
|
53
|
-
) {
|
|
54
|
-
Message.error({
|
|
55
|
-
content: "请求超时!"
|
|
56
|
-
});
|
|
57
|
-
} else {
|
|
58
|
-
Message.error({ content: err.message || "未知错误!" });
|
|
59
|
-
}
|
|
60
|
-
return Promise.resolve(err);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
export default { axios };
|