openatc-components 0.1.134 → 0.1.137
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/package.json
CHANGED
package/src/kisscomps/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import PhaseDirectionText from './components/PhaseDirectionText/index'
|
|
|
28
28
|
import PhaseDirectionSelect from './components/PhaseDirectionSelect/index'
|
|
29
29
|
import patternConfig from './components/patternConfig/index.vue'
|
|
30
30
|
import XiaoKanBan from './components/XiaoKanBan/index.vue'
|
|
31
|
-
import { setToken,
|
|
31
|
+
import { setToken, setHost, setIsCheckPermission, setUserRoles, setPermissions } from '../utils/auth.js'
|
|
32
32
|
import componentsGlobalParam from '../store/modules/globalParam'
|
|
33
33
|
|
|
34
34
|
import en from '../i18n/language/en'
|
|
@@ -76,7 +76,6 @@ const language = {
|
|
|
76
76
|
const func = {
|
|
77
77
|
setHost,
|
|
78
78
|
setToken,
|
|
79
|
-
setOpenatcToken,
|
|
80
79
|
setUserRoles,
|
|
81
80
|
setPermissions,
|
|
82
81
|
setIsCheckPermission
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from './HttpurlMgr'
|
|
15
15
|
import axios from 'axios'
|
|
16
16
|
import * as localStorge from './localStorage'
|
|
17
|
-
import { removeToken } from '../../utils/auth'
|
|
17
|
+
import { removeToken, getToken } from '../../utils/auth'
|
|
18
18
|
|
|
19
19
|
axios.defaults.withCredentials = true
|
|
20
20
|
export const getAxios = () => {
|
|
@@ -32,7 +32,8 @@ export class KissApi {
|
|
|
32
32
|
获取服务器地址 需要在storage中设置 key=host的value
|
|
33
33
|
*/
|
|
34
34
|
GetHost () {
|
|
35
|
-
return
|
|
35
|
+
return getToken()
|
|
36
|
+
// return localStorge.getStorage('host')
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/*
|
package/src/utils/auth.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
var localStorage = require('../lib/publicjs/localStorage')
|
|
13
13
|
|
|
14
14
|
const nameSpace = 'openatc_conponents_'
|
|
15
|
-
|
|
15
|
+
let LoginKey = 'token'
|
|
16
16
|
// eslint-disable-next-line camelcase
|
|
17
|
-
|
|
17
|
+
let Prefix = 'Prefix'
|
|
18
18
|
const LoginHost = nameSpace + 'kisshost'
|
|
19
19
|
const typeKey = 'type'
|
|
20
20
|
const type = 'edge'
|
|
@@ -27,22 +27,22 @@ const userRoles = 'kiss_userRoles'
|
|
|
27
27
|
const isCheckPermission = 'kiss_isCheckPermission'
|
|
28
28
|
|
|
29
29
|
export function getToken () {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
return localStorage.getStorage(LoginKey)
|
|
30
|
+
let key = getPrefix() + LoginKey
|
|
31
|
+
return localStorage.getStorage(key)
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
export function setToken (token) {
|
|
37
|
-
|
|
34
|
+
export function setToken (token, prefix = '') {
|
|
35
|
+
setPrefix(prefix)
|
|
36
|
+
let key = getPrefix() + LoginKey
|
|
37
|
+
return localStorage.setStorage(key, token)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export function
|
|
41
|
-
return localStorage.getStorage(
|
|
40
|
+
export function getPrefix () {
|
|
41
|
+
return localStorage.getStorage(Prefix)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export function
|
|
45
|
-
return localStorage.setStorage(
|
|
44
|
+
export function setPrefix (prifix) {
|
|
45
|
+
return localStorage.setStorage(Prefix, prifix)
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export function SetSimuUserKey (key) {
|