yuang-framework-ui-pc 1.1.23 → 1.1.25
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/es/yu-slider-captcha-dialog/SliderCaptcha.js +2 -144
- package/es/yu-slider-captcha-dialog/index.js +3 -12
- package/es/yu-slider-captcha-dialog/style/index.scss +67 -0
- package/lib/yu-slider-captcha-dialog/SliderCaptcha.cjs +5 -147
- package/lib/yu-slider-captcha-dialog/index.cjs +2 -11
- package/lib/yu-slider-captcha-dialog/style/index.scss +67 -0
- package/package.json +1 -1
- package/es/yu-slider-captcha-dialog/style.css +0 -45
- package/lib/yu-slider-captcha-dialog/style.css +0 -45
|
@@ -1,149 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, nextTick, openBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, unref, normalizeStyle, normalizeClass, createCommentVNode, toDisplayString, Fragment } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { showErrorMessage } from "../../node_modules/yuang-framework-ui-common/lib/utils/messageUtils";
|
|
5
|
-
import { alertMessageBox } from "../../node_modules/yuang-framework-ui-common/lib/utils/messageBoxUtils";
|
|
6
|
-
import { clearSsoAccessToken, getSsoLoginUrl, setSsoAccessToken } from "../../node_modules/yuang-framework-ui-common/lib/utils/ssoUtils";
|
|
7
|
-
import { getGatewayConfigUrl, initGatewayConfig, clearGatewayConfig } from "../../node_modules/yuang-framework-ui-common/lib/config/gatewayConfig";
|
|
8
|
-
import { getLocalStorageItem } from "../../node_modules/yuang-framework-ui-common/lib/utils/storageUtils";
|
|
2
|
+
import { http } from "yuang-framework-ui-common/lib/config/httpConfig";
|
|
3
|
+
import { getBaseUrl } from "yuang-framework-ui-common/lib/utils/urlUtils";
|
|
9
4
|
import { CircleClose } from "@element-plus/icons-vue";
|
|
10
|
-
const router = useRouter();
|
|
11
|
-
const messageMap = {
|
|
12
|
-
requestError: "请求异常",
|
|
13
|
-
responseSturctError: "响应结构错误"
|
|
14
|
-
};
|
|
15
|
-
const apiBaseUrl = "/gateway-server";
|
|
16
|
-
const http = axios.create({
|
|
17
|
-
baseURL: apiBaseUrl,
|
|
18
|
-
timeout: 1e4,
|
|
19
|
-
headers: {}
|
|
20
|
-
});
|
|
21
|
-
http.interceptors.request.use(async (config) => {
|
|
22
|
-
let gatewayAccessToken = getLocalStorageItem("gatewayAccessToken") ?? "";
|
|
23
|
-
if (!gatewayAccessToken && config.url != getGatewayConfigUrl) {
|
|
24
|
-
await initGatewayConfig();
|
|
25
|
-
}
|
|
26
|
-
beforeRequestConfig(config);
|
|
27
|
-
return config;
|
|
28
|
-
}, (error) => {
|
|
29
|
-
showErrorMessage((error == null ? void 0 : error.message) || messageMap.requestError);
|
|
30
|
-
return Promise.reject(error);
|
|
31
|
-
});
|
|
32
|
-
http.interceptors.response.use(async (res) => {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
34
|
-
if (!((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.statusCode)) {
|
|
35
|
-
showErrorMessage(messageMap.responseSturctError);
|
|
36
|
-
return Promise.reject(new Error(messageMap.responseSturctError));
|
|
37
|
-
}
|
|
38
|
-
if (((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.statusCode) !== 200) {
|
|
39
|
-
if (((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.statusCode) === 401) {
|
|
40
|
-
alertMessageBox({
|
|
41
|
-
title: "系统提示",
|
|
42
|
-
message: "登录状态已过期, 请退出重新登录!",
|
|
43
|
-
confirmButtonText: "重新登录",
|
|
44
|
-
callback: (action) => {
|
|
45
|
-
if (action === "confirm") {
|
|
46
|
-
clearSsoAccessToken();
|
|
47
|
-
window.location.href = getSsoLoginUrl() || "";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return Promise.reject(new Error((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.message));
|
|
52
|
-
} else if (((_e = res == null ? void 0 : res.data) == null ? void 0 : _e.statusCode) === 500822001) {
|
|
53
|
-
clearGatewayConfig();
|
|
54
|
-
window.location.reload();
|
|
55
|
-
return Promise.reject(new Error((_f = res == null ? void 0 : res.data) == null ? void 0 : _f.message));
|
|
56
|
-
} else if (((_g = res == null ? void 0 : res.data) == null ? void 0 : _g.statusCode) === 500815001) {
|
|
57
|
-
showErrorMessage(((_h = res == null ? void 0 : res.data) == null ? void 0 : _h.message) || messageMap.requestError);
|
|
58
|
-
clearSsoAccessToken();
|
|
59
|
-
window.location.href = getSsoLoginUrl() || "";
|
|
60
|
-
return Promise.reject(new Error((_i = res == null ? void 0 : res.data) == null ? void 0 : _i.message));
|
|
61
|
-
} else if (((_j = res == null ? void 0 : res.data) == null ? void 0 : _j.statusCode) === 500815005) {
|
|
62
|
-
await refreshSsoAccessToken(res);
|
|
63
|
-
return axios.request(res.config);
|
|
64
|
-
} else if (((_k = res == null ? void 0 : res.data) == null ? void 0 : _k.statusCode) === 500815006) {
|
|
65
|
-
const fullPath = router.currentRoute.value.fullPath;
|
|
66
|
-
router.push(`/sso/auth/index?ssoRedirectRoutePath=${encodeURIComponent(fullPath)}`);
|
|
67
|
-
return;
|
|
68
|
-
} else if (((_l = res == null ? void 0 : res.data) == null ? void 0 : _l.statusCode) === 500815003) {
|
|
69
|
-
showErrorMessage(((_m = res == null ? void 0 : res.data) == null ? void 0 : _m.message) || messageMap.requestError);
|
|
70
|
-
return Promise.reject(new Error((_n = res == null ? void 0 : res.data) == null ? void 0 : _n.message));
|
|
71
|
-
}
|
|
72
|
-
showErrorMessage(((_o = res == null ? void 0 : res.data) == null ? void 0 : _o.message) || messageMap.requestError);
|
|
73
|
-
return Promise.reject(new Error((_p = res == null ? void 0 : res.data) == null ? void 0 : _p.message));
|
|
74
|
-
}
|
|
75
|
-
return res;
|
|
76
|
-
}, (error) => {
|
|
77
|
-
var _a, _b;
|
|
78
|
-
let errorMessage = "";
|
|
79
|
-
if ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) {
|
|
80
|
-
let { statusCode, message } = (_b = error == null ? void 0 : error.response) == null ? void 0 : _b.data;
|
|
81
|
-
if (statusCode !== 200) {
|
|
82
|
-
errorMessage = message;
|
|
83
|
-
}
|
|
84
|
-
errorMessage = errorMessage || messageMap.requestError;
|
|
85
|
-
} else {
|
|
86
|
-
errorMessage = (error == null ? void 0 : error.message) || messageMap.requestError;
|
|
87
|
-
}
|
|
88
|
-
showErrorMessage(errorMessage);
|
|
89
|
-
return Promise.reject(error);
|
|
90
|
-
});
|
|
91
|
-
const beforeRequestConfig = (config) => {
|
|
92
|
-
if (!config.url) {
|
|
93
|
-
return console.error("参数[url]不存在");
|
|
94
|
-
}
|
|
95
|
-
config.headers["X-Requested-With"] = "XMLHttpRequest";
|
|
96
|
-
let gatewayAccessToken = getLocalStorageItem("gatewayAccessToken") ?? "";
|
|
97
|
-
let gatewayPublicKey = getLocalStorageItem("gatewayPublicKey") ?? "";
|
|
98
|
-
let ssoAccessToken = getLocalStorageItem("ssoAccessToken") ?? "";
|
|
99
|
-
if (gatewayAccessToken) {
|
|
100
|
-
config.headers["Gateway-Access-Token"] = gatewayAccessToken;
|
|
101
|
-
}
|
|
102
|
-
if (gatewayPublicKey) {
|
|
103
|
-
config.headers["Gateway-Public-Key"] = gatewayPublicKey;
|
|
104
|
-
}
|
|
105
|
-
if (ssoAccessToken) {
|
|
106
|
-
config.headers["Sso-Access-Token"] = ssoAccessToken;
|
|
107
|
-
}
|
|
108
|
-
config.headers["Request-Id"] = (/* @__PURE__ */ new Date()).getTime().toString() + parseInt((Math.random() * 1e4).toString()).toString();
|
|
109
|
-
};
|
|
110
|
-
const refreshSsoAccessToken = (res) => {
|
|
111
|
-
let ssoRefreshToken = encodeURIComponent(getLocalStorageItem("ssoRefreshToken") ?? "");
|
|
112
|
-
if (!ssoRefreshToken) {
|
|
113
|
-
return showErrorMessage("参数[ssoRefreshToken]为空");
|
|
114
|
-
}
|
|
115
|
-
return new Promise((resolve, reject) => {
|
|
116
|
-
const config = res.config;
|
|
117
|
-
config.params = {
|
|
118
|
-
ssoRefreshToken
|
|
119
|
-
};
|
|
120
|
-
axios.get(`/sso-api/client/sso-auth/getSsoRefreshToken`, config).then((res2) => {
|
|
121
|
-
var _a;
|
|
122
|
-
if (((_a = res2 == null ? void 0 : res2.data) == null ? void 0 : _a.statusCode) !== 200) {
|
|
123
|
-
return reject();
|
|
124
|
-
}
|
|
125
|
-
setSsoAccessToken(res2.data.data);
|
|
126
|
-
return resolve(void 0);
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
const getBaseUrl = (url) => {
|
|
131
|
-
url = url || location.href;
|
|
132
|
-
let arr = url.split("/");
|
|
133
|
-
if (arr.length > 3) {
|
|
134
|
-
var baseUrl = "";
|
|
135
|
-
for (let i = 0; i < arr.length; i++) {
|
|
136
|
-
if (i <= 3) {
|
|
137
|
-
baseUrl += arr[i] + "/";
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (baseUrl) {
|
|
141
|
-
return baseUrl.substring(0, baseUrl.length - 1);
|
|
142
|
-
}
|
|
143
|
-
} else {
|
|
144
|
-
console.error("地址存在问题");
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
5
|
const _hoisted_1 = { class: "slider-captcha-container" };
|
|
148
6
|
const _hoisted_2 = { class: "slider-captcha-title" };
|
|
149
7
|
const _hoisted_3 = /* @__PURE__ */ createElementVNode("i", { class: "el-icon-refresh" }, null, -1);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, createVNode, createCommentVNode
|
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, createVNode, createCommentVNode } from "vue";
|
|
2
2
|
import SliderCaptcha from "./SliderCaptcha";
|
|
3
|
-
const _withScopeId = (n) => (pushScopeId("data-v-7e32a294"), n = n(), popScopeId(), n);
|
|
4
3
|
const _hoisted_1 = {
|
|
5
4
|
key: 0,
|
|
6
5
|
class: "slider-captcha-dialog-container"
|
|
7
6
|
};
|
|
8
|
-
const _hoisted_2 = /* @__PURE__ */
|
|
7
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "slider-captcha-dialog-modal" }, null, -1);
|
|
9
8
|
const _hoisted_3 = { class: "slider-captcha-dialog-wrapper" };
|
|
10
9
|
const _hoisted_4 = { class: "slider-captcha-dialog slide-up" };
|
|
11
10
|
const _hoisted_5 = { class: "slider-captcha" };
|
|
@@ -62,14 +61,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
61
|
};
|
|
63
62
|
}
|
|
64
63
|
});
|
|
65
|
-
const _export_sfc = (sfc, props) => {
|
|
66
|
-
const target = sfc.__vccOpts || sfc;
|
|
67
|
-
for (const [key, val] of props) {
|
|
68
|
-
target[key] = val;
|
|
69
|
-
}
|
|
70
|
-
return target;
|
|
71
|
-
};
|
|
72
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7e32a294"]]);
|
|
73
64
|
export {
|
|
74
|
-
|
|
65
|
+
_sfc_main as default
|
|
75
66
|
};
|
|
@@ -1,3 +1,70 @@
|
|
|
1
|
+
.slider-captcha-dialog-container {
|
|
2
|
+
.slider-captcha-dialog-modal {
|
|
3
|
+
position: fixed;
|
|
4
|
+
left: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
opacity: 0.7;
|
|
9
|
+
background: #000;
|
|
10
|
+
|
|
11
|
+
z-index: 1000;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.slider-captcha-dialog-wrapper {
|
|
15
|
+
position: fixed;
|
|
16
|
+
top: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
bottom: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
margin: 0;
|
|
22
|
+
|
|
23
|
+
z-index: 1001;
|
|
24
|
+
|
|
25
|
+
.slider-captcha-dialog {
|
|
26
|
+
// 在移动端禁止上下滑动,添加position: fixed;
|
|
27
|
+
position: fixed;
|
|
28
|
+
background: #fff;
|
|
29
|
+
padding: 10px;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
|
|
32
|
+
top: 50%;
|
|
33
|
+
left: 50%;
|
|
34
|
+
transform: translate(-50%, -50%);
|
|
35
|
+
|
|
36
|
+
height: 255px;
|
|
37
|
+
//height: 458px;
|
|
38
|
+
|
|
39
|
+
width: 320px;
|
|
40
|
+
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
|
|
44
|
+
border-radius: 4px;
|
|
45
|
+
|
|
46
|
+
.slider-captcha {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.slide-up {
|
|
51
|
+
animation: slide-up-animation 0.5s ease;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes slide-up-animation {
|
|
55
|
+
0% {
|
|
56
|
+
transform: translate(-50%, 100%);
|
|
57
|
+
}
|
|
58
|
+
100% {
|
|
59
|
+
transform: translate(-50%, -50%);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
1
68
|
.slider-captcha-container {
|
|
2
69
|
.slider-captcha {
|
|
3
70
|
position: relative;
|
|
@@ -1,150 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const messageUtils = require("../../node_modules/yuang-framework-ui-common/lib/utils/messageUtils");
|
|
6
|
-
const messageBoxUtils = require("../../node_modules/yuang-framework-ui-common/lib/utils/messageBoxUtils");
|
|
7
|
-
const ssoUtils = require("../../node_modules/yuang-framework-ui-common/lib/utils/ssoUtils");
|
|
8
|
-
const gatewayConfig = require("../../node_modules/yuang-framework-ui-common/lib/config/gatewayConfig");
|
|
9
|
-
const storageUtils = require("../../node_modules/yuang-framework-ui-common/lib/utils/storageUtils");
|
|
3
|
+
const httpConfig = require("yuang-framework-ui-common/lib/config/httpConfig");
|
|
4
|
+
const urlUtils = require("yuang-framework-ui-common/lib/utils/urlUtils");
|
|
10
5
|
const iconsVue = require("@element-plus/icons-vue");
|
|
11
|
-
const router = vueRouter.useRouter();
|
|
12
|
-
const messageMap = {
|
|
13
|
-
requestError: "请求异常",
|
|
14
|
-
responseSturctError: "响应结构错误"
|
|
15
|
-
};
|
|
16
|
-
const apiBaseUrl = "/gateway-server";
|
|
17
|
-
const http = axios.create({
|
|
18
|
-
baseURL: apiBaseUrl,
|
|
19
|
-
timeout: 1e4,
|
|
20
|
-
headers: {}
|
|
21
|
-
});
|
|
22
|
-
http.interceptors.request.use(async (config) => {
|
|
23
|
-
let gatewayAccessToken = storageUtils.getLocalStorageItem("gatewayAccessToken") ?? "";
|
|
24
|
-
if (!gatewayAccessToken && config.url != gatewayConfig.getGatewayConfigUrl) {
|
|
25
|
-
await gatewayConfig.initGatewayConfig();
|
|
26
|
-
}
|
|
27
|
-
beforeRequestConfig(config);
|
|
28
|
-
return config;
|
|
29
|
-
}, (error) => {
|
|
30
|
-
messageUtils.showErrorMessage((error == null ? void 0 : error.message) || messageMap.requestError);
|
|
31
|
-
return Promise.reject(error);
|
|
32
|
-
});
|
|
33
|
-
http.interceptors.response.use(async (res) => {
|
|
34
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
35
|
-
if (!((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.statusCode)) {
|
|
36
|
-
messageUtils.showErrorMessage(messageMap.responseSturctError);
|
|
37
|
-
return Promise.reject(new Error(messageMap.responseSturctError));
|
|
38
|
-
}
|
|
39
|
-
if (((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.statusCode) !== 200) {
|
|
40
|
-
if (((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.statusCode) === 401) {
|
|
41
|
-
messageBoxUtils.alertMessageBox({
|
|
42
|
-
title: "系统提示",
|
|
43
|
-
message: "登录状态已过期, 请退出重新登录!",
|
|
44
|
-
confirmButtonText: "重新登录",
|
|
45
|
-
callback: (action) => {
|
|
46
|
-
if (action === "confirm") {
|
|
47
|
-
ssoUtils.clearSsoAccessToken();
|
|
48
|
-
window.location.href = ssoUtils.getSsoLoginUrl() || "";
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return Promise.reject(new Error((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.message));
|
|
53
|
-
} else if (((_e = res == null ? void 0 : res.data) == null ? void 0 : _e.statusCode) === 500822001) {
|
|
54
|
-
gatewayConfig.clearGatewayConfig();
|
|
55
|
-
window.location.reload();
|
|
56
|
-
return Promise.reject(new Error((_f = res == null ? void 0 : res.data) == null ? void 0 : _f.message));
|
|
57
|
-
} else if (((_g = res == null ? void 0 : res.data) == null ? void 0 : _g.statusCode) === 500815001) {
|
|
58
|
-
messageUtils.showErrorMessage(((_h = res == null ? void 0 : res.data) == null ? void 0 : _h.message) || messageMap.requestError);
|
|
59
|
-
ssoUtils.clearSsoAccessToken();
|
|
60
|
-
window.location.href = ssoUtils.getSsoLoginUrl() || "";
|
|
61
|
-
return Promise.reject(new Error((_i = res == null ? void 0 : res.data) == null ? void 0 : _i.message));
|
|
62
|
-
} else if (((_j = res == null ? void 0 : res.data) == null ? void 0 : _j.statusCode) === 500815005) {
|
|
63
|
-
await refreshSsoAccessToken(res);
|
|
64
|
-
return axios.request(res.config);
|
|
65
|
-
} else if (((_k = res == null ? void 0 : res.data) == null ? void 0 : _k.statusCode) === 500815006) {
|
|
66
|
-
const fullPath = router.currentRoute.value.fullPath;
|
|
67
|
-
router.push(`/sso/auth/index?ssoRedirectRoutePath=${encodeURIComponent(fullPath)}`);
|
|
68
|
-
return;
|
|
69
|
-
} else if (((_l = res == null ? void 0 : res.data) == null ? void 0 : _l.statusCode) === 500815003) {
|
|
70
|
-
messageUtils.showErrorMessage(((_m = res == null ? void 0 : res.data) == null ? void 0 : _m.message) || messageMap.requestError);
|
|
71
|
-
return Promise.reject(new Error((_n = res == null ? void 0 : res.data) == null ? void 0 : _n.message));
|
|
72
|
-
}
|
|
73
|
-
messageUtils.showErrorMessage(((_o = res == null ? void 0 : res.data) == null ? void 0 : _o.message) || messageMap.requestError);
|
|
74
|
-
return Promise.reject(new Error((_p = res == null ? void 0 : res.data) == null ? void 0 : _p.message));
|
|
75
|
-
}
|
|
76
|
-
return res;
|
|
77
|
-
}, (error) => {
|
|
78
|
-
var _a, _b;
|
|
79
|
-
let errorMessage = "";
|
|
80
|
-
if ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) {
|
|
81
|
-
let { statusCode, message } = (_b = error == null ? void 0 : error.response) == null ? void 0 : _b.data;
|
|
82
|
-
if (statusCode !== 200) {
|
|
83
|
-
errorMessage = message;
|
|
84
|
-
}
|
|
85
|
-
errorMessage = errorMessage || messageMap.requestError;
|
|
86
|
-
} else {
|
|
87
|
-
errorMessage = (error == null ? void 0 : error.message) || messageMap.requestError;
|
|
88
|
-
}
|
|
89
|
-
messageUtils.showErrorMessage(errorMessage);
|
|
90
|
-
return Promise.reject(error);
|
|
91
|
-
});
|
|
92
|
-
const beforeRequestConfig = (config) => {
|
|
93
|
-
if (!config.url) {
|
|
94
|
-
return console.error("参数[url]不存在");
|
|
95
|
-
}
|
|
96
|
-
config.headers["X-Requested-With"] = "XMLHttpRequest";
|
|
97
|
-
let gatewayAccessToken = storageUtils.getLocalStorageItem("gatewayAccessToken") ?? "";
|
|
98
|
-
let gatewayPublicKey = storageUtils.getLocalStorageItem("gatewayPublicKey") ?? "";
|
|
99
|
-
let ssoAccessToken = storageUtils.getLocalStorageItem("ssoAccessToken") ?? "";
|
|
100
|
-
if (gatewayAccessToken) {
|
|
101
|
-
config.headers["Gateway-Access-Token"] = gatewayAccessToken;
|
|
102
|
-
}
|
|
103
|
-
if (gatewayPublicKey) {
|
|
104
|
-
config.headers["Gateway-Public-Key"] = gatewayPublicKey;
|
|
105
|
-
}
|
|
106
|
-
if (ssoAccessToken) {
|
|
107
|
-
config.headers["Sso-Access-Token"] = ssoAccessToken;
|
|
108
|
-
}
|
|
109
|
-
config.headers["Request-Id"] = (/* @__PURE__ */ new Date()).getTime().toString() + parseInt((Math.random() * 1e4).toString()).toString();
|
|
110
|
-
};
|
|
111
|
-
const refreshSsoAccessToken = (res) => {
|
|
112
|
-
let ssoRefreshToken = encodeURIComponent(storageUtils.getLocalStorageItem("ssoRefreshToken") ?? "");
|
|
113
|
-
if (!ssoRefreshToken) {
|
|
114
|
-
return messageUtils.showErrorMessage("参数[ssoRefreshToken]为空");
|
|
115
|
-
}
|
|
116
|
-
return new Promise((resolve, reject) => {
|
|
117
|
-
const config = res.config;
|
|
118
|
-
config.params = {
|
|
119
|
-
ssoRefreshToken
|
|
120
|
-
};
|
|
121
|
-
axios.get(`/sso-api/client/sso-auth/getSsoRefreshToken`, config).then((res2) => {
|
|
122
|
-
var _a;
|
|
123
|
-
if (((_a = res2 == null ? void 0 : res2.data) == null ? void 0 : _a.statusCode) !== 200) {
|
|
124
|
-
return reject();
|
|
125
|
-
}
|
|
126
|
-
ssoUtils.setSsoAccessToken(res2.data.data);
|
|
127
|
-
return resolve(void 0);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
const getBaseUrl = (url) => {
|
|
132
|
-
url = url || location.href;
|
|
133
|
-
let arr = url.split("/");
|
|
134
|
-
if (arr.length > 3) {
|
|
135
|
-
var baseUrl = "";
|
|
136
|
-
for (let i = 0; i < arr.length; i++) {
|
|
137
|
-
if (i <= 3) {
|
|
138
|
-
baseUrl += arr[i] + "/";
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if (baseUrl) {
|
|
142
|
-
return baseUrl.substring(0, baseUrl.length - 1);
|
|
143
|
-
}
|
|
144
|
-
} else {
|
|
145
|
-
console.error("地址存在问题");
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
6
|
const _hoisted_1 = { class: "slider-captcha-container" };
|
|
149
7
|
const _hoisted_2 = { class: "slider-captcha-title" };
|
|
150
8
|
const _hoisted_3 = /* @__PURE__ */ vue.createElementVNode("i", { class: "el-icon-refresh" }, null, -1);
|
|
@@ -219,7 +77,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
219
77
|
}
|
|
220
78
|
};
|
|
221
79
|
const getCaptcha = () => {
|
|
222
|
-
http.get("/framework-api/standard/framework-captcha/getSliderCaptcha", { params: {} }).then((res) => {
|
|
80
|
+
httpConfig.http.get("/framework-api/standard/framework-captcha/getSliderCaptcha", { params: {} }).then((res) => {
|
|
223
81
|
key.value = res.data.data.key;
|
|
224
82
|
block.value.src = res.data.data.blockSrc;
|
|
225
83
|
block.value.style.top = res.data.data.blockY + "px";
|
|
@@ -249,7 +107,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
249
107
|
image2.crossOrigin = "Anonymous";
|
|
250
108
|
image2.onload = onload;
|
|
251
109
|
image2.onerror = () => {
|
|
252
|
-
image2.src = `${getBaseUrl()}/img/slider-captcha/pic-0.jpeg`;
|
|
110
|
+
image2.src = `${urlUtils.getBaseUrl()}/img/slider-captcha/pic-0.jpeg`;
|
|
253
111
|
};
|
|
254
112
|
image2.src = getImageSrc();
|
|
255
113
|
return image2;
|
|
@@ -382,7 +240,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
382
240
|
key: key.value,
|
|
383
241
|
captcha: moveLength
|
|
384
242
|
};
|
|
385
|
-
http.get("/framework-api/standard/framework-captcha/validateSliderCaptcha", { params }).then((res) => {
|
|
243
|
+
httpConfig.http.get("/framework-api/standard/framework-captcha/validateSliderCaptcha", { params }).then((res) => {
|
|
386
244
|
emit("success", { key: key.value, value: moveLength });
|
|
387
245
|
}).catch(() => {
|
|
388
246
|
verifyFailEvent();
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
3
|
const SliderCaptcha = require("./SliderCaptcha");
|
|
4
|
-
const _withScopeId = (n) => (vue.pushScopeId("data-v-7e32a294"), n = n(), vue.popScopeId(), n);
|
|
5
4
|
const _hoisted_1 = {
|
|
6
5
|
key: 0,
|
|
7
6
|
class: "slider-captcha-dialog-container"
|
|
8
7
|
};
|
|
9
|
-
const _hoisted_2 = /* @__PURE__ */
|
|
8
|
+
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "slider-captcha-dialog-modal" }, null, -1);
|
|
10
9
|
const _hoisted_3 = { class: "slider-captcha-dialog-wrapper" };
|
|
11
10
|
const _hoisted_4 = { class: "slider-captcha-dialog slide-up" };
|
|
12
11
|
const _hoisted_5 = { class: "slider-captcha" };
|
|
@@ -63,12 +62,4 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
64
|
});
|
|
66
|
-
|
|
67
|
-
const target = sfc.__vccOpts || sfc;
|
|
68
|
-
for (const [key, val] of props) {
|
|
69
|
-
target[key] = val;
|
|
70
|
-
}
|
|
71
|
-
return target;
|
|
72
|
-
};
|
|
73
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7e32a294"]]);
|
|
74
|
-
module.exports = index;
|
|
65
|
+
module.exports = _sfc_main;
|
|
@@ -1,3 +1,70 @@
|
|
|
1
|
+
.slider-captcha-dialog-container {
|
|
2
|
+
.slider-captcha-dialog-modal {
|
|
3
|
+
position: fixed;
|
|
4
|
+
left: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
opacity: 0.7;
|
|
9
|
+
background: #000;
|
|
10
|
+
|
|
11
|
+
z-index: 1000;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.slider-captcha-dialog-wrapper {
|
|
15
|
+
position: fixed;
|
|
16
|
+
top: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
bottom: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
margin: 0;
|
|
22
|
+
|
|
23
|
+
z-index: 1001;
|
|
24
|
+
|
|
25
|
+
.slider-captcha-dialog {
|
|
26
|
+
// 在移动端禁止上下滑动,添加position: fixed;
|
|
27
|
+
position: fixed;
|
|
28
|
+
background: #fff;
|
|
29
|
+
padding: 10px;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
|
|
32
|
+
top: 50%;
|
|
33
|
+
left: 50%;
|
|
34
|
+
transform: translate(-50%, -50%);
|
|
35
|
+
|
|
36
|
+
height: 255px;
|
|
37
|
+
//height: 458px;
|
|
38
|
+
|
|
39
|
+
width: 320px;
|
|
40
|
+
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
|
|
44
|
+
border-radius: 4px;
|
|
45
|
+
|
|
46
|
+
.slider-captcha {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.slide-up {
|
|
51
|
+
animation: slide-up-animation 0.5s ease;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes slide-up-animation {
|
|
55
|
+
0% {
|
|
56
|
+
transform: translate(-50%, 100%);
|
|
57
|
+
}
|
|
58
|
+
100% {
|
|
59
|
+
transform: translate(-50%, -50%);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
1
68
|
.slider-captcha-container {
|
|
2
69
|
.slider-captcha {
|
|
3
70
|
position: relative;
|
package/package.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
.slider-captcha-dialog-container .slider-captcha-dialog-modal[data-v-7e32a294] {
|
|
2
|
-
position: fixed;
|
|
3
|
-
left: 0;
|
|
4
|
-
top: 0;
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
opacity: 0.7;
|
|
8
|
-
background: #000;
|
|
9
|
-
z-index: 1000;
|
|
10
|
-
}
|
|
11
|
-
.slider-captcha-dialog-container .slider-captcha-dialog-wrapper[data-v-7e32a294] {
|
|
12
|
-
position: fixed;
|
|
13
|
-
top: 0;
|
|
14
|
-
right: 0;
|
|
15
|
-
bottom: 0;
|
|
16
|
-
left: 0;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
margin: 0;
|
|
19
|
-
z-index: 1001;
|
|
20
|
-
}
|
|
21
|
-
.slider-captcha-dialog-container .slider-captcha-dialog-wrapper .slider-captcha-dialog[data-v-7e32a294] {
|
|
22
|
-
position: fixed;
|
|
23
|
-
background: #fff;
|
|
24
|
-
padding: 10px;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
top: 50%;
|
|
27
|
-
left: 50%;
|
|
28
|
-
transform: translate(-50%, -50%);
|
|
29
|
-
height: 255px;
|
|
30
|
-
width: 320px;
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
border-radius: 4px;
|
|
34
|
-
}
|
|
35
|
-
.slider-captcha-dialog-container .slider-captcha-dialog-wrapper .slide-up[data-v-7e32a294] {
|
|
36
|
-
animation: slide-up-animation-7e32a294 0.5s ease;
|
|
37
|
-
}
|
|
38
|
-
@keyframes slide-up-animation-7e32a294 {
|
|
39
|
-
0% {
|
|
40
|
-
transform: translate(-50%, 100%);
|
|
41
|
-
}
|
|
42
|
-
100% {
|
|
43
|
-
transform: translate(-50%, -50%);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
.slider-captcha-dialog-container .slider-captcha-dialog-modal[data-v-7e32a294] {
|
|
2
|
-
position: fixed;
|
|
3
|
-
left: 0;
|
|
4
|
-
top: 0;
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
opacity: 0.7;
|
|
8
|
-
background: #000;
|
|
9
|
-
z-index: 1000;
|
|
10
|
-
}
|
|
11
|
-
.slider-captcha-dialog-container .slider-captcha-dialog-wrapper[data-v-7e32a294] {
|
|
12
|
-
position: fixed;
|
|
13
|
-
top: 0;
|
|
14
|
-
right: 0;
|
|
15
|
-
bottom: 0;
|
|
16
|
-
left: 0;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
margin: 0;
|
|
19
|
-
z-index: 1001;
|
|
20
|
-
}
|
|
21
|
-
.slider-captcha-dialog-container .slider-captcha-dialog-wrapper .slider-captcha-dialog[data-v-7e32a294] {
|
|
22
|
-
position: fixed;
|
|
23
|
-
background: #fff;
|
|
24
|
-
padding: 10px;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
top: 50%;
|
|
27
|
-
left: 50%;
|
|
28
|
-
transform: translate(-50%, -50%);
|
|
29
|
-
height: 255px;
|
|
30
|
-
width: 320px;
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
border-radius: 4px;
|
|
34
|
-
}
|
|
35
|
-
.slider-captcha-dialog-container .slider-captcha-dialog-wrapper .slide-up[data-v-7e32a294] {
|
|
36
|
-
animation: slide-up-animation-7e32a294 0.5s ease;
|
|
37
|
-
}
|
|
38
|
-
@keyframes slide-up-animation-7e32a294 {
|
|
39
|
-
0% {
|
|
40
|
-
transform: translate(-50%, 100%);
|
|
41
|
-
}
|
|
42
|
-
100% {
|
|
43
|
-
transform: translate(-50%, -50%);
|
|
44
|
-
}
|
|
45
|
-
}
|