Compare commits
2 Commits
2364ff6278
...
2c848827b3
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c848827b3 | |||
| 8ec002300b |
@@ -59,6 +59,7 @@ const whiteList = [
|
|||||||
|
|
||||||
// 路由加载前
|
// 路由加载前
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
|
debugger
|
||||||
start()
|
start()
|
||||||
loadStart()
|
loadStart()
|
||||||
if (getAccessToken()) {
|
if (getAccessToken()) {
|
||||||
|
|||||||
@@ -82,7 +82,6 @@
|
|||||||
mode="pop"
|
mode="pop"
|
||||||
@success="handleLogin"
|
@success="handleLogin"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
@@ -141,7 +140,6 @@ const loginData = reactive({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
const getCode = async () => {
|
const getCode = async () => {
|
||||||
// 情况一,未开启:则直接登录
|
// 情况一,未开启:则直接登录
|
||||||
@@ -174,7 +172,6 @@ const getCookie = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据域名,获得租户信息
|
// 根据域名,获得租户信息
|
||||||
const getTenantByWebsite = async () => {
|
const getTenantByWebsite = async () => {
|
||||||
const website = location.host
|
const website = location.host
|
||||||
@@ -189,7 +186,6 @@ const loading = ref() // ElLoading.service 返回的实例
|
|||||||
const handleLogin = async (params) => {
|
const handleLogin = async (params) => {
|
||||||
loginLoading.value = true
|
loginLoading.value = true
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const data = await validForm()
|
const data = await validForm()
|
||||||
if (!data) return
|
if (!data) return
|
||||||
|
|
||||||
@@ -212,28 +208,23 @@ const handleLogin = async (params) => {
|
|||||||
authUtil.setToken(res)
|
authUtil.setToken(res)
|
||||||
debugger
|
debugger
|
||||||
if (!redirect.value) {
|
if (!redirect.value) {
|
||||||
|
|
||||||
redirect.value = '/'
|
redirect.value = '/'
|
||||||
}
|
}
|
||||||
// 判断是否为SSO登录
|
// 判断是否为SSO登录
|
||||||
if (redirect.value.indexOf('sso') !== -1) {
|
if (redirect.value.indexOf('sso') !== -1) {
|
||||||
window.location.href = window.location.href.replace('/login?redirect=', '')
|
window.location.href = window.location.href.replace('/login?redirect=', '')
|
||||||
} else {
|
} else {
|
||||||
const queryParams = new URLSearchParams(window.location.search);
|
const queryParams = new URLSearchParams(window.location.search)
|
||||||
const ticketUrl = queryParams.get('url'); // 获取查询参数值,例如 ?paramName=value 中的 value
|
const ticketUrl = queryParams.get('url') // 获取查询参数值,例如 ?paramName=value 中的 value
|
||||||
const accessToken =authUtil.getAccessToken();
|
const accessToken = authUtil.getAccessToken()
|
||||||
debugger
|
debugger
|
||||||
console.log(accessToken);
|
console.log(accessToken)
|
||||||
if(ticketUrl!=null){
|
if (ticketUrl != null) {
|
||||||
var urll=ticketUrl+"?ticket="+accessToken;
|
var urll = ticketUrl + '?ticket=' + accessToken
|
||||||
window.location.href = urll
|
window.location.href = urll
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loginLoading.value = false
|
loginLoading.value = false
|
||||||
|
|||||||
Reference in New Issue
Block a user