qsh 1 month ago
parent d27d5b3d62
commit cfa352ecb7
  1. 4
      .env.base
  2. 4
      src/router/modules/remaining.ts
  3. 4
      src/views/Login/components/LoginForm.vue

@ -6,9 +6,9 @@ VITE_DEV=true
# 请求路径 # 请求路径
# VITE_BASE_URL='http://localhost:48080' # VITE_BASE_URL='http://localhost:48080'
VITE_BASE_URL='http://47.98.161.246:48080' # VITE_BASE_URL='http://47.98.161.246:48080'
# VITE_BASE_URL='http://114.55.169.15:48080' # VITE_BASE_URL='http://114.55.169.15:48080'
# VITE_BASE_URL='http://114.215.207.150:48080' VITE_BASE_URL='http://114.215.207.150:48080'
# 上传路径 # 上传路径
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload' VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'

@ -51,7 +51,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
} }
}, },
{ {
path: '', path: '/',
component: Layout, component: Layout,
redirect: '/index', redirect: '/index',
name: '', name: '',
@ -60,7 +60,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
}, },
children: [ children: [
{ {
path: 'index', path: '/index',
component: () => import('@/views/Home/index.vue'), component: () => import('@/views/Home/index.vue'),
name: 'Home', name: 'Home',
meta: { meta: {

@ -115,7 +115,6 @@ import { ElLoading } from 'element-plus'
import { useIcon } from '@/hooks/web/useIcon' import { useIcon } from '@/hooks/web/useIcon'
import * as authUtil from '@/utils/auth' import * as authUtil from '@/utils/auth'
import { usePermissionStore } from '@/store/modules/permission'
import * as LoginApi from '@/api/login' import * as LoginApi from '@/api/login'
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin' import { LoginStateEnum, useFormValid, useLoginState } from './useLogin'
@ -127,7 +126,6 @@ const formLogin = ref()
const { validForm } = useFormValid(formLogin) const { validForm } = useFormValid(formLogin)
const { setLoginState, getLoginState } = useLoginState() const { setLoginState, getLoginState } = useLoginState()
const { currentRoute, push } = useRouter() const { currentRoute, push } = useRouter()
const permissionStore = usePermissionStore()
const redirect = ref('') const redirect = ref('')
const loginLoading = ref(false) const loginLoading = ref(false)
const verify = ref() const verify = ref()
@ -217,7 +215,7 @@ const handleLogin = async (params) => {
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 {
push({ path: redirect.value || permissionStore.addRouters[0].path }) push({ path: redirect.value || '/index' })
} }
} catch { } catch {
loginLoading.value = false loginLoading.value = false

Loading…
Cancel
Save