@ganwei-web/ganwei-pc-cli 6.3.1 → 6.3.2
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/ganwei-iotcenter-index-6.2.3/configuration/moduleConfiguration.json +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/public/static/js/getLanguage.js +9 -10
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/App.vue +10 -35
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/components/indexRightContent/headerRight/expirationReminder/index.vue +7 -3
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/router.js +120 -18
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/date.ts +2 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/dom.ts +2 -2
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/env.ts +6 -0
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/file.ts +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/number.ts +6 -6
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/performance.ts +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/string.ts +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/xss-filter.ts +4 -0
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/.eslintrc.cjs +2 -2
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/src/request/models/response/template.ts +0 -0
- package/package.json +1 -1
- package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/mixins/judgePermission.js +0 -65
- /package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/src/{request/models/request/index.ts → enum/template.ts} +0 -0
- /package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-template/src/request/models/{response/index.ts → request/template.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"addressMapping": {
|
|
3
|
-
"ganwei-iotcenter-equip-lists": "http://127.0.0.1:
|
|
3
|
+
"ganwei-iotcenter-equip-lists": "http://127.0.0.1:8440",
|
|
4
4
|
"ganwei-iotcenter-event-querys": "http://127.0.0.1:8380",
|
|
5
5
|
"ganwei-iotcenter-index": "http://127.0.0.1:8160",
|
|
6
6
|
"ganwei-iotcenter-login": "http://127.0.0.1:8180",
|
package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/public/static/js/getLanguage.js
CHANGED
|
@@ -46,7 +46,6 @@ window.getElementLanguages = async () => {
|
|
|
46
46
|
//① 是否需要请求 element.el
|
|
47
47
|
const needElementRequest = !elementPkg || isEmptyObject(elementPkg['el']) || isEmptyObject(elementPkg['ele']);
|
|
48
48
|
|
|
49
|
-
|
|
50
49
|
//② 是否需要请求 publics(login.publics)
|
|
51
50
|
const needPublicsRequest = !loginPkg || isEmptyObject(loginPkg['publics']);
|
|
52
51
|
|
|
@@ -72,8 +71,8 @@ window.haveExistLanguage = (pluginName, menuName) => {
|
|
|
72
71
|
const key = pluginName + '__' + menuName;
|
|
73
72
|
const pkg = JSON.parse(sessionStorage.languagePackage || '{}');
|
|
74
73
|
return pkg[langType] &&
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
pkg[langType][key] &&
|
|
75
|
+
Object.keys(pkg[langType][key]).length > 0;
|
|
77
76
|
} catch {
|
|
78
77
|
return false;
|
|
79
78
|
}
|
|
@@ -98,12 +97,12 @@ window.requestLanguage = async (pluginName, menuName, packageId, vm) => {
|
|
|
98
97
|
}).catch(() => ({}));
|
|
99
98
|
}
|
|
100
99
|
|
|
101
|
-
window.updateLanguage = (pluginName, menuName,vm, i18n) => {
|
|
100
|
+
window.updateLanguage = (pluginName, menuName, vm, i18n) => {
|
|
102
101
|
if (!(vm && vm.i18nInstance) && !(i18n && i18n._vm)) {
|
|
103
102
|
console.log(pluginName + '__' + menuName + ' 更新语言失败,没有找到 i18n 实例');
|
|
104
103
|
return;
|
|
105
104
|
}
|
|
106
|
-
|
|
105
|
+
|
|
107
106
|
const langType = localStorage.languageType || 'zh-CN';
|
|
108
107
|
let languagePackage = {};
|
|
109
108
|
try {
|
|
@@ -159,8 +158,8 @@ window.haveExistLanguage = (pluginName, menuName) => {
|
|
|
159
158
|
const key = pluginName + '__' + menuName;
|
|
160
159
|
const pkg = JSON.parse(sessionStorage.languagePackage || '{}');
|
|
161
160
|
return pkg[langType] &&
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
pkg[langType][key] &&
|
|
162
|
+
Object.keys(pkg[langType][key]).length > 0;
|
|
164
163
|
} catch {
|
|
165
164
|
return false;
|
|
166
165
|
}
|
|
@@ -186,9 +185,9 @@ window.saveToSession = (pluginName, menuName, language) => {
|
|
|
186
185
|
languagePackage[langType]['publics'] = language['publics'] || {};
|
|
187
186
|
}
|
|
188
187
|
else if (key === 'ganwei-iotcenter-login__element') {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
languagePackage[langType]['element'] = language || {};
|
|
189
|
+
languagePackage[langType]['el'] = language['el'] || {};
|
|
190
|
+
languagePackage[langType]['ele'] = language || {};
|
|
192
191
|
}
|
|
193
192
|
sessionStorage.setItem('languagePackage', JSON.stringify(languagePackage));
|
|
194
193
|
} catch (e) {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="app">
|
|
3
|
-
<!--
|
|
4
|
-
<el-config-provider>
|
|
5
|
-
<router-view v-cloak
|
|
3
|
+
<!-- 验证通过且语言包加载完成后显示页面 -->
|
|
4
|
+
<el-config-provider v-if="isShow">
|
|
5
|
+
<router-view v-cloak />
|
|
6
6
|
</el-config-provider>
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
9
9
|
<script>
|
|
10
10
|
import muduleObserve from '@ganwei-web/gw-base-utils-plus/moduleObserve/dist/index.es.js'
|
|
11
11
|
|
|
12
|
-
import judgePermission from './mixins/judgePermission'
|
|
13
12
|
import { setTheme } from './utils/storage.ts'
|
|
14
13
|
|
|
15
14
|
export default {
|
|
16
|
-
mixins: [
|
|
15
|
+
mixins: [muduleObserve],
|
|
17
16
|
name: 'App',
|
|
18
17
|
data() {
|
|
19
18
|
return {
|
|
20
|
-
isNoRequestObserveGetPublic: true
|
|
19
|
+
isNoRequestObserveGetPublic: true,
|
|
20
|
+
isLoading: true
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
mounted() {
|
|
@@ -31,35 +31,6 @@ export default {
|
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<style>
|
|
34
|
-
/* 登录验证加载状态 */
|
|
35
|
-
.auth-loading {
|
|
36
|
-
position: fixed;
|
|
37
|
-
top: 0;
|
|
38
|
-
left: 0;
|
|
39
|
-
right: 0;
|
|
40
|
-
bottom: 0;
|
|
41
|
-
background: var(--frame-main-background, #121622);
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
z-index: 9999;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.loading-spinner {
|
|
49
|
-
width: 40px;
|
|
50
|
-
height: 40px;
|
|
51
|
-
border: 3px solid var(--frame-main-border, #2a3441);
|
|
52
|
-
border-top-color: var(--gw-color-primary, #3875ff);
|
|
53
|
-
border-radius: 50%;
|
|
54
|
-
animation: spin 0.8s linear infinite;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@keyframes spin {
|
|
58
|
-
to {
|
|
59
|
-
transform: rotate(360deg);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
34
|
html {
|
|
64
35
|
height: 100%;
|
|
65
36
|
--left: calc(var(--maxActiveWidth) + 10);
|
|
@@ -115,4 +86,8 @@ html body div {
|
|
|
115
86
|
iframe {
|
|
116
87
|
border: none;
|
|
117
88
|
}
|
|
89
|
+
|
|
90
|
+
.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
|
|
91
|
+
background-color: var(--table-body-background__hover) !important;
|
|
92
|
+
}
|
|
118
93
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-dialog :title="$t('login.应用到期提醒')" class="systemInformation_main" v-model="dialogVisible" :before-close="closeDialog" width="690" top="6vh" center append-to="#index">
|
|
3
|
-
<el-table :data="expirepluginList" height="
|
|
3
|
+
<el-table :data="expirepluginList" height="400px" border >
|
|
4
4
|
<template v-slot:empty>
|
|
5
5
|
<div class="noDataTips"></div>
|
|
6
6
|
</template>
|
|
@@ -27,11 +27,11 @@ export default {
|
|
|
27
27
|
dialogVisible: false,
|
|
28
28
|
expirepluginList: [],
|
|
29
29
|
stateList: [{
|
|
30
|
-
value:
|
|
30
|
+
value: false,
|
|
31
31
|
label: 'login.即将到期',
|
|
32
32
|
type: 'warning'
|
|
33
33
|
}, {
|
|
34
|
-
value:
|
|
34
|
+
value: true,
|
|
35
35
|
label: 'login.已到期',
|
|
36
36
|
type: 'error'
|
|
37
37
|
}]
|
|
@@ -102,6 +102,10 @@ export default {
|
|
|
102
102
|
justify-content: center;
|
|
103
103
|
align-items: center;
|
|
104
104
|
}
|
|
105
|
+
.el-table {
|
|
106
|
+
min-height: 240px;
|
|
107
|
+
max-height: 480px;
|
|
108
|
+
}
|
|
105
109
|
:deep(td.el-table__cell) {
|
|
106
110
|
border-bottom: 1px solid var(--frame-main-border) !important;
|
|
107
111
|
}
|
|
@@ -4,31 +4,133 @@ import {
|
|
|
4
4
|
createRouter,
|
|
5
5
|
createWebHashHistory
|
|
6
6
|
} from 'vue-router'
|
|
7
|
+
import hostMap from './hostMap.js'
|
|
7
8
|
|
|
8
9
|
const INDEX = () => import('./views/Index.vue')
|
|
9
10
|
const jumpIframe = () => import('@/views/jumpIframe/index.vue')
|
|
11
|
+
|
|
10
12
|
const router = createRouter({
|
|
11
13
|
history: createWebHashHistory(),
|
|
12
|
-
routes: [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
routes: [
|
|
15
|
+
{
|
|
16
|
+
path: '/',
|
|
17
|
+
redirect: '/Index'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
path: '/Index',
|
|
21
|
+
name: 'INDEX',
|
|
22
|
+
component: INDEX,
|
|
23
|
+
meta: { requiresAuth: true },
|
|
24
|
+
children: [
|
|
25
|
+
{
|
|
26
|
+
path: 'jumpIframe/:packageName([^/]*)/:route(.*)',
|
|
27
|
+
name: 'jumpIframe3',
|
|
28
|
+
component: jumpIframe,
|
|
29
|
+
meta: { requiresAuth: true }
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
28
33
|
]
|
|
29
34
|
})
|
|
35
|
+
|
|
36
|
+
// ==================== 登录验证状态管理 ====================
|
|
37
|
+
let authCheckPromise = null
|
|
38
|
+
let isAuthChecked = false
|
|
39
|
+
|
|
40
|
+
// 带超时的请求
|
|
41
|
+
function fetchWithTimeout(promise, timeout) {
|
|
42
|
+
return Promise.race([
|
|
43
|
+
promise,
|
|
44
|
+
new Promise((_, reject) =>
|
|
45
|
+
setTimeout(() => reject(new Error('请求超时')), timeout)
|
|
46
|
+
)
|
|
47
|
+
])
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 用 AxiosBuilder 构建的带拦截器的实例
|
|
51
|
+
function getAxiosInstance() {
|
|
52
|
+
return window.AxiosBuilder?.axios || window.axios
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 验证登录状态(复用同一个 Promise,避免重复请求)
|
|
56
|
+
async function checkAuthStatus() {
|
|
57
|
+
if (isAuthChecked) return true
|
|
58
|
+
if (authCheckPromise) return authCheckPromise
|
|
59
|
+
|
|
60
|
+
authCheckPromise = (async () => {
|
|
61
|
+
try {
|
|
62
|
+
console.time('getSystemInfo')
|
|
63
|
+
const res = await fetchWithTimeout(
|
|
64
|
+
getAxiosInstance().get('/IoT/api/v3/Auth/GetSystemRuntimeInfo'),
|
|
65
|
+
3000
|
|
66
|
+
)
|
|
67
|
+
console.timeEnd('getSystemInfo')
|
|
68
|
+
|
|
69
|
+
if (res?.data?.code == 200 || res?.data?.code == -99999) {
|
|
70
|
+
isAuthChecked = true
|
|
71
|
+
return true
|
|
72
|
+
}
|
|
73
|
+
return false
|
|
74
|
+
} catch (err) {
|
|
75
|
+
console.log('登录验证失败:', err?.message || err)
|
|
76
|
+
return false
|
|
77
|
+
} finally {
|
|
78
|
+
authCheckPromise = null
|
|
79
|
+
}
|
|
80
|
+
})()
|
|
81
|
+
|
|
82
|
+
return authCheckPromise
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 跳转登录页
|
|
86
|
+
function redirectToLogin() {
|
|
87
|
+
const url = process.env.NODE_ENV === 'development'
|
|
88
|
+
? hostMap('ganwei-iotcenter-login')
|
|
89
|
+
: '/ganwei-iotcenter-login/#/'
|
|
90
|
+
window.location.href = url
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 设置开发环境参数(从 URL 参数中读取)
|
|
94
|
+
function setDevelopmentParams() {
|
|
95
|
+
let map = window?.getParameterMap() || {}
|
|
96
|
+
if (process.env.NODE_ENV === 'development' && map) {
|
|
97
|
+
if (map.get('languageType')) {
|
|
98
|
+
sessionStorage.languageType = localStorage.languageType = map.get('languageType')
|
|
99
|
+
}
|
|
100
|
+
sessionStorage.userName = map.get('userName')
|
|
101
|
+
sessionStorage.passwordPolicy = map.get('passwordPolicy')
|
|
102
|
+
if (map.get('multiPark')) {
|
|
103
|
+
localStorage.multiPark = map.get('multiPark')
|
|
104
|
+
}
|
|
105
|
+
if (!sessionStorage.getItem('theme') || sessionStorage.getItem('theme') == 'null' || sessionStorage.getItem('theme') == 'undefined') {
|
|
106
|
+
sessionStorage.setItem('theme', map.get('theme'))
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ==================== 路由守卫 ====================
|
|
30
112
|
router.beforeEach(async (to, from, next) => {
|
|
31
|
-
|
|
113
|
+
|
|
114
|
+
// 不需要认证的路由直接放行
|
|
115
|
+
if (!to.meta.requiresAuth) {
|
|
116
|
+
next()
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// 设置开发环境参数
|
|
121
|
+
setDevelopmentParams()
|
|
122
|
+
|
|
123
|
+
// 验证登录状态
|
|
124
|
+
const isValid = await checkAuthStatus()
|
|
125
|
+
|
|
126
|
+
if (isValid) {
|
|
127
|
+
next()
|
|
128
|
+
} else {
|
|
129
|
+
// 验证失败,跳转登录页
|
|
130
|
+
redirectToLogin()
|
|
131
|
+
}
|
|
32
132
|
})
|
|
33
|
-
|
|
133
|
+
|
|
134
|
+
router.afterEach(() => { })
|
|
135
|
+
|
|
34
136
|
export default router
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import dayjs from 'dayjs'
|
|
2
2
|
import relativeTime from 'dayjs/plugin/relativeTime'
|
|
3
|
+
|
|
3
4
|
import 'dayjs/locale/zh-cn'
|
|
4
5
|
|
|
5
6
|
dayjs.extend(relativeTime)
|
|
@@ -16,7 +17,7 @@ dayjs.locale('zh-cn')
|
|
|
16
17
|
*/
|
|
17
18
|
export function formatDate(
|
|
18
19
|
date: Date | number | string,
|
|
19
|
-
format
|
|
20
|
+
format = 'YYYY-MM-DD HH:mm:ss'
|
|
20
21
|
): string {
|
|
21
22
|
return dayjs(date).format(format)
|
|
22
23
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
export const ENV = {
|
|
2
|
+
|
|
2
3
|
/** 应用标题 */
|
|
3
4
|
APP_TITLE: import.meta.env.VITE_APP_TITLE,
|
|
5
|
+
|
|
4
6
|
/** 应用端口 */
|
|
5
7
|
APP_VERSION: import.meta.env.VITE_APP_PORT,
|
|
8
|
+
|
|
6
9
|
/** proxy代理配置 */
|
|
7
10
|
APP_ENV: import.meta.env.VITE_APP_TARGET_URL,
|
|
11
|
+
|
|
8
12
|
/** 本地地址 */
|
|
9
13
|
API_URL: import.meta.env.VITE_APP_THIS_URL,
|
|
14
|
+
|
|
10
15
|
/** 是否开发环境 */
|
|
11
16
|
IS_DEV: import.meta.env.DEV,
|
|
17
|
+
|
|
12
18
|
/** 是否生产环境 */
|
|
13
19
|
IS_PROD: import.meta.env.PROD
|
|
14
20
|
} as const
|
|
@@ -36,7 +36,7 @@ export function fileToBase64(file: File): Promise<string> {
|
|
|
36
36
|
*/
|
|
37
37
|
export function base64ToBlob(
|
|
38
38
|
base64: string,
|
|
39
|
-
mimeType
|
|
39
|
+
mimeType = 'application/octet-stream'
|
|
40
40
|
): Blob {
|
|
41
41
|
const byteString = atob(base64.split(',')[1])
|
|
42
42
|
const arrayBuffer = new ArrayBuffer(byteString.length)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param decimals - 小数位数,默认 0
|
|
5
5
|
* @returns 格式化后的数字字符串
|
|
6
6
|
*/
|
|
7
|
-
export function formatNumber(num: number | string, decimals
|
|
7
|
+
export function formatNumber(num: number | string, decimals = 0): string {
|
|
8
8
|
const number = Number(num)
|
|
9
9
|
if (isNaN(number)) return '0'
|
|
10
10
|
|
|
@@ -22,8 +22,8 @@ export function formatNumber(num: number | string, decimals: number = 0): string
|
|
|
22
22
|
*/
|
|
23
23
|
export function formatMoney(
|
|
24
24
|
amount: number | string,
|
|
25
|
-
currency
|
|
26
|
-
decimals
|
|
25
|
+
currency = '¥',
|
|
26
|
+
decimals = 2
|
|
27
27
|
): string {
|
|
28
28
|
const number = Number(amount)
|
|
29
29
|
if (isNaN(number)) return `${currency}0.00`
|
|
@@ -38,7 +38,7 @@ export function formatMoney(
|
|
|
38
38
|
*/
|
|
39
39
|
export function formatPercent(
|
|
40
40
|
value: number | string,
|
|
41
|
-
decimals
|
|
41
|
+
decimals = 2
|
|
42
42
|
): string {
|
|
43
43
|
const number = Number(value)
|
|
44
44
|
if (isNaN(number)) return '0%'
|
|
@@ -51,7 +51,7 @@ export function formatPercent(
|
|
|
51
51
|
* @param bytes - 字节数
|
|
52
52
|
* @param decimals - 小数位数,默认 2
|
|
53
53
|
*/
|
|
54
|
-
export function formatFileSize(bytes: number, decimals
|
|
54
|
+
export function formatFileSize(bytes: number, decimals = 2): string {
|
|
55
55
|
if (bytes === 0) return '0 B'
|
|
56
56
|
|
|
57
57
|
const k = 1024
|
|
@@ -78,6 +78,6 @@ export function random(min: number, max: number): number {
|
|
|
78
78
|
/**
|
|
79
79
|
* 生成随机 ID
|
|
80
80
|
*/
|
|
81
|
-
export function generateId(prefix
|
|
81
|
+
export function generateId(prefix = ''): string {
|
|
82
82
|
return `${prefix}${Date.now()}${Math.random().toString(36).substr(2, 9)}`
|
|
83
83
|
}
|
package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/performance.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export function debounce<T extends (...args: any[]) => any>(
|
|
8
8
|
func: T,
|
|
9
9
|
wait: number,
|
|
10
|
-
immediate
|
|
10
|
+
immediate = false
|
|
11
11
|
): (...args: Parameters<T>) => ReturnType<T> | undefined {
|
|
12
12
|
let timeout: ReturnType<typeof setTimeout> | null = null
|
|
13
13
|
|
|
@@ -64,7 +64,7 @@ export function maskAddress(address: string): string {
|
|
|
64
64
|
/**
|
|
65
65
|
* 截断字符串
|
|
66
66
|
*/
|
|
67
|
-
export function truncate(str: string, length: number, suffix
|
|
67
|
+
export function truncate(str: string, length: number, suffix = '...'): string {
|
|
68
68
|
if (str.length <= length) return str
|
|
69
69
|
return str.substring(0, length) + suffix
|
|
70
70
|
}
|
package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/utils/xss-filter.ts
CHANGED
|
@@ -109,12 +109,16 @@ export function stripJavascriptProtocol(str: string): string {
|
|
|
109
109
|
* @returns 过滤后的安全字符串
|
|
110
110
|
*/
|
|
111
111
|
export interface XssFilterOptions {
|
|
112
|
+
|
|
112
113
|
/** 是否转义 HTML,默认 true */
|
|
113
114
|
escapeHtml?: boolean
|
|
115
|
+
|
|
114
116
|
/** 是否移除危险标签,默认 true */
|
|
115
117
|
stripDangerousTags?: boolean
|
|
118
|
+
|
|
116
119
|
/** 是否移除危险属性,默认 true */
|
|
117
120
|
stripDangerousAttrs?: boolean
|
|
121
|
+
|
|
118
122
|
/** 是否移除 javascript 协议,默认 true */
|
|
119
123
|
stripJavascriptProtocol?: boolean
|
|
120
124
|
}
|
|
@@ -26,12 +26,12 @@ module.exports = {
|
|
|
26
26
|
plugins: ['vue', '@typescript-eslint'],
|
|
27
27
|
|
|
28
28
|
/*
|
|
29
|
-
|
|
29
|
+
下面这些rules是用来设置从插件来的规范代码的规则,使用必须去掉前缀eslint-plugin-
|
|
30
30
|
主要有如下的设置规则,可以设置字符串也可以设置数字,两者效果一致
|
|
31
31
|
"off" -> 0 关闭规则
|
|
32
32
|
"warn" -> 1 开启警告规则
|
|
33
33
|
"error" -> 2 开启错误规则
|
|
34
|
-
|
|
34
|
+
*/
|
|
35
35
|
// 参数说明:
|
|
36
36
|
// 参数1 : 错误等级
|
|
37
37
|
// 参数2 : 处理方式
|
|
File without changes
|
package/package.json
CHANGED
package/ganwei-iotcenter-index-6.2.3/packages/ganwei-iotcenter-index/src/mixins/judgePermission.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export default {
|
|
3
|
-
data: () => ({
|
|
4
|
-
isLogin: false,
|
|
5
|
-
requestTimeout: 3000 // 请求超时时间
|
|
6
|
-
}),
|
|
7
|
-
created() {
|
|
8
|
-
let isLgStatus = window.getParameterMap().get('isLgStatus')
|
|
9
|
-
if (isLgStatus) {
|
|
10
|
-
sessionStorage.setItem('isLgStatus', isLgStatus);
|
|
11
|
-
}
|
|
12
|
-
if (isLgStatus == 'false') {
|
|
13
|
-
this.jumpLogin()
|
|
14
|
-
return
|
|
15
|
-
}
|
|
16
|
-
console.time("getSystemInfo")
|
|
17
|
-
this.checkLoginStatus()
|
|
18
|
-
let map = window?.getParameterMap() || {}
|
|
19
|
-
if (process.env.NODE_ENV == "development" && map) {
|
|
20
|
-
if (map.get("languageType")) { sessionStorage.languageType = localStorage.languageType = map.get("languageType") }
|
|
21
|
-
sessionStorage.userName = map.get("userName")
|
|
22
|
-
sessionStorage.passwordPolicy = map.get("passwordPolicy")
|
|
23
|
-
if (map.get("multiPark")) { localStorage.multiPark = map.get("multiPark") }
|
|
24
|
-
if (!sessionStorage.getItem('theme') || sessionStorage.getItem('theme') == 'null' || sessionStorage.getItem('theme') == 'undefined') {
|
|
25
|
-
sessionStorage.setItem('theme', map.get("theme"))
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
methods: {
|
|
30
|
-
// 带超时的请求
|
|
31
|
-
fetchWithTimeout(promise, timeout) {
|
|
32
|
-
return Promise.race([
|
|
33
|
-
promise,
|
|
34
|
-
new Promise((_, reject) =>
|
|
35
|
-
setTimeout(() => reject(new Error('请求超时')), timeout)
|
|
36
|
-
)
|
|
37
|
-
])
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
// 检查登录状态
|
|
41
|
-
async checkLoginStatus() {
|
|
42
|
-
try {
|
|
43
|
-
const res = await this.fetchWithTimeout(
|
|
44
|
-
this.$api.getSystemInfo(),
|
|
45
|
-
this.requestTimeout
|
|
46
|
-
)
|
|
47
|
-
console.timeEnd("getSystemInfo")
|
|
48
|
-
|
|
49
|
-
if (res?.data?.code == 200 || res?.data?.code == -99999) {
|
|
50
|
-
this.isLogin = true
|
|
51
|
-
} else {
|
|
52
|
-
this.jumpLogin()
|
|
53
|
-
}
|
|
54
|
-
} catch (err) {
|
|
55
|
-
console.log('登录验证失败:', err?.message || err)
|
|
56
|
-
this.jumpLogin()
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
jumpLogin() {
|
|
61
|
-
let url = (process.env.NODE_ENV === "development" ? this.$hostMap('ganwei-iotcenter-login') : '/ganwei-iotcenter-login/#/')
|
|
62
|
-
window.location.href = url
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
File without changes
|