VITE_AUTHORITY = 'http://192.168.11.11:8090' | VITE_AUTHORITY = 'http://192.168.11.11:8090' | ||||
VITE_CLIENT_ID = 'tuoheng-pilot-admin' | VITE_CLIENT_ID = 'tuoheng-pilot-admin' | ||||
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA==' | |||||
VITE_REDIRECT_URI = 'http://192.168.11.11:7011/login' | |||||
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA==' |
# mock base api | # mock base api | ||||
VITE_APP_GLOB_BASE_API_MOCK = '/api-mock' | VITE_APP_GLOB_BASE_API_MOCK = '/api-mock' | ||||
VITE_AUTHORITY = 'https://oidc.test.t-aaron.com' | |||||
VITE_AUTHORITY = 'https://login-test.t-aaron.com' | |||||
VITE_CLIENT_ID = 'tuoheng-pilot-admin' | VITE_CLIENT_ID = 'tuoheng-pilot-admin' | ||||
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA==' | |||||
VITE_REDIRECT_URI = 'http://192.168.12.8:3050/login' | |||||
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA==' |
VITE_AUTHORITY = 'https://oidc.t-aaron.com' | VITE_AUTHORITY = 'https://oidc.t-aaron.com' | ||||
VITE_CLIENT_ID = 'tuoheng-pilot-admin' | VITE_CLIENT_ID = 'tuoheng-pilot-admin' | ||||
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA==' | |||||
VITE_REDIRECT_URI = 'https://pilot.t-aaron.com/login' | |||||
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA==' |
VITE_APP_USE_MOCK = false | VITE_APP_USE_MOCK = false | ||||
# proxy | # proxy | ||||
VITE_PROXY = [["","http://192.168.11.241:9089"]] | |||||
VITE_PROXY = [["","http://106.15.120.154:9089"]] | |||||
# base api | # base api | ||||
VITE_APP_GLOB_BASE_API = '' | VITE_APP_GLOB_BASE_API = '' | ||||
VITE_AUTHORITY = 'https://oidc.test.t-aaron.com' | |||||
VITE_AUTHORITY = 'https://login-test.t-aaron.com' | |||||
VITE_CLIENT_ID = 'tuoheng-pilot-admin' | VITE_CLIENT_ID = 'tuoheng-pilot-admin' | ||||
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA==' | |||||
VITE_REDIRECT_URI = 'http://192.168.11.241:9089/login' | |||||
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA==' |
securityJsCode: 'eb839debb422cd65cc598664067ee7d8' | securityJsCode: 'eb839debb422cd65cc598664067ee7d8' | ||||
} | } | ||||
</script> | </script> | ||||
<style type="text/css"> | |||||
<!-- <style type="text/css"> | |||||
.amap-logo { | .amap-logo { | ||||
display: none; | display: none; | ||||
opacity: 0 !important; | opacity: 0 !important; | ||||
.amap-copyright { | .amap-copyright { | ||||
opacity: 0; | opacity: 0; | ||||
} | } | ||||
</style> | |||||
</style> --> | |||||
</head> | </head> | ||||
<body> | <body> |
if (userInfo) { | if (userInfo) { | ||||
const { token_type, access_token } = userInfo | const { token_type, access_token } = userInfo | ||||
config.headers.Authorization = `${token_type} ${access_token}` | config.headers.Authorization = `${token_type} ${access_token}` | ||||
const { VITE_CLIENT_ID } = import.meta.env | |||||
config.headers['Client-Id'] = VITE_CLIENT_ID | |||||
return config | return config | ||||
} else { | } else { | ||||
signoutRedirect() | signoutRedirect() |
export const initServe = () => { | export const initServe = () => { | ||||
if (oidcManager) return oidcManager | if (oidcManager) return oidcManager | ||||
const { VITE_AUTHORITY, VITE_CLIENT_ID, VITE_CLIENT_SECRET, VITE_REDIRECT_URI } = import.meta.env | |||||
const { VITE_AUTHORITY, VITE_CLIENT_ID, VITE_CLIENT_SECRET } = import.meta.env | |||||
oidcManager = new UserManager({ | oidcManager = new UserManager({ | ||||
/* 认证服务器 */ | /* 认证服务器 */ | ||||
authority: VITE_AUTHORITY, | authority: VITE_AUTHORITY, | ||||
client_id: VITE_CLIENT_ID, | client_id: VITE_CLIENT_ID, | ||||
client_secret: VITE_CLIENT_SECRET, | client_secret: VITE_CLIENT_SECRET, | ||||
/* 回调客户端页面 */ | /* 回调客户端页面 */ | ||||
redirect_uri: VITE_REDIRECT_URI, | |||||
post_logout_redirect_uri: VITE_REDIRECT_URI, | |||||
redirect_uri: `${window.location.origin}/login`, | |||||
post_logout_redirect_uri: `${window.location.origin}/login`, | |||||
response_type: 'code', | response_type: 'code', | ||||
/* 授权范围 */ | /* 授权范围 */ | ||||
scope: 'openid profile', | scope: 'openid profile', |
pilotStart({ id: data.id }).then(({ code, msg }) => { | pilotStart({ id: data.id }).then(({ code, msg }) => { | ||||
if (code === 0) { | if (code === 0) { | ||||
emit('close') | emit('close') | ||||
} else { | |||||
$message.error(msg) | |||||
} | } | ||||
}) | }) | ||||
} | } | ||||
pilotEnd({ id: data.id }).then(({ code, msg }) => { | pilotEnd({ id: data.id }).then(({ code, msg }) => { | ||||
if (code === 0) { | if (code === 0) { | ||||
emit('close') | emit('close') | ||||
} else { | |||||
$message.error(msg) | |||||
} | } | ||||
}) | }) | ||||
} | } |
@positive-click="userForm.patrolLocation = startVal" | @positive-click="userForm.patrolLocation = startVal" | ||||
@negative-click="showStart = false" | @negative-click="showStart = false" | ||||
> | > | ||||
<map-comp @mapEmit="startHandle" /> | |||||
<map-comp v-if="showStart" @mapEmit="startHandle" /> | |||||
</n-modal> | </n-modal> | ||||
<n-modal | <n-modal | ||||
@positive-click="userForm.endValue = endVal" | @positive-click="userForm.endValue = endVal" | ||||
@negative-click="showEnd = false" | @negative-click="showEnd = false" | ||||
> | > | ||||
<map-comp @mapEmit="endHandle" /> | |||||
<map-comp v-if="showEnd" @mapEmit="endHandle" /> | |||||
</n-modal> | </n-modal> | ||||
</template> | </template> |