登录页面修改
parent
ecfe1b6145
commit
5e2ce9461f
8
.env
8
.env
|
|
@ -1,5 +1,5 @@
|
|||
# 标题
|
||||
VITE_APP_TITLE=芋道管理系统
|
||||
VITE_APP_TITLE=人力资源系统
|
||||
|
||||
# 项目本地运行端口号
|
||||
VITE_PORT=80
|
||||
|
|
@ -20,6 +20,6 @@ VITE_APP_DOCALERT_ENABLE=true
|
|||
VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc
|
||||
|
||||
# 默认账户密码
|
||||
VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码
|
||||
VITE_APP_DEFAULT_LOGIN_USERNAME = admin
|
||||
VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123
|
||||
VITE_APP_DEFAULT_LOGIN_TENANT = 阿克苏塔里木农村商业银行股份有限公司
|
||||
VITE_APP_DEFAULT_LOGIN_USERNAME =
|
||||
VITE_APP_DEFAULT_LOGIN_PASSWORD =
|
||||
|
|
|
|||
12794
pnpm-lock.yaml
12794
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 55 KiB |
|
|
@ -5,7 +5,7 @@
|
|||
<el-avatar :size="60">
|
||||
<Icon icon="ep:avatar" :size="60" />
|
||||
</el-avatar>
|
||||
<span class="text-18px font-bold">芋道源码</span>
|
||||
<span class="text-18px font-bold">人力资源系统</span>
|
||||
</div>
|
||||
<Icon icon="tdesign:qrcode" :size="20" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -198,9 +198,9 @@ const loginData = reactive({
|
|||
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE !== 'false',
|
||||
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE !== 'false',
|
||||
loginForm: {
|
||||
tenantName: '芋道源码',
|
||||
username: 'admin',
|
||||
password: 'admin123',
|
||||
tenantName: '人力资源系统',
|
||||
username: '',
|
||||
password: '',
|
||||
captchaVerification: '',
|
||||
rememberMe: false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,64 +82,64 @@
|
|||
mode="pop"
|
||||
@success="handleLogin"
|
||||
/>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item>
|
||||
<el-row :gutter="5" justify="space-between" style="width: 100%">
|
||||
<el-col :span="8">
|
||||
<XButton
|
||||
:title="t('login.btnMobile')"
|
||||
class="w-[100%]"
|
||||
@click="setLoginState(LoginStateEnum.MOBILE)"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<XButton
|
||||
:title="t('login.btnQRCode')"
|
||||
class="w-[100%]"
|
||||
@click="setLoginState(LoginStateEnum.QR_CODE)"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<XButton
|
||||
:title="t('login.btnRegister')"
|
||||
class="w-[100%]"
|
||||
@click="setLoginState(LoginStateEnum.REGISTER)"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item>
|
||||
<div class="w-[100%] flex justify-between">
|
||||
<Icon
|
||||
v-for="(item, key) in socialList"
|
||||
:key="key"
|
||||
:icon="item.icon"
|
||||
:size="30"
|
||||
class="anticon cursor-pointer"
|
||||
color="#999"
|
||||
@click="doSocialLogin(item.type)"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider content-position="center">萌新必读</el-divider>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item>
|
||||
<div class="w-[100%] flex justify-between">
|
||||
<el-link href="https://doc.iocoder.cn/" target="_blank">📚开发指南</el-link>
|
||||
<el-link href="https://doc.iocoder.cn/video/" target="_blank">🔥视频教程</el-link>
|
||||
<el-link href="https://www.iocoder.cn/Interview/good-collection/" target="_blank">
|
||||
⚡面试手册
|
||||
</el-link>
|
||||
<el-link href="http://static.yudao.iocoder.cn/mp/Aix9975.jpeg" target="_blank">
|
||||
🤝外包咨询
|
||||
</el-link>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-row :gutter="5" justify="space-between" style="width: 100%">-->
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <XButton-->
|
||||
<!-- :title="t('login.btnMobile')"-->
|
||||
<!-- class="w-[100%]"-->
|
||||
<!-- @click="setLoginState(LoginStateEnum.MOBILE)"-->
|
||||
<!-- />-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <XButton-->
|
||||
<!-- :title="t('login.btnQRCode')"-->
|
||||
<!-- class="w-[100%]"-->
|
||||
<!-- @click="setLoginState(LoginStateEnum.QR_CODE)"-->
|
||||
<!-- />-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <XButton-->
|
||||
<!-- :title="t('login.btnRegister')"-->
|
||||
<!-- class="w-[100%]"-->
|
||||
<!-- @click="setLoginState(LoginStateEnum.REGISTER)"-->
|
||||
<!-- />-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider>-->
|
||||
<!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <div class="w-[100%] flex justify-between">-->
|
||||
<!-- <Icon-->
|
||||
<!-- v-for="(item, key) in socialList"-->
|
||||
<!-- :key="key"-->
|
||||
<!-- :icon="item.icon"-->
|
||||
<!-- :size="30"-->
|
||||
<!-- class="anticon cursor-pointer"-->
|
||||
<!-- color="#999"-->
|
||||
<!-- @click="doSocialLogin(item.type)"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-divider content-position="center">萌新必读</el-divider>-->
|
||||
<!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <div class="w-[100%] flex justify-between">-->
|
||||
<!-- <el-link href="https://doc.iocoder.cn/" target="_blank">📚开发指南</el-link>-->
|
||||
<!-- <el-link href="https://doc.iocoder.cn/video/" target="_blank">🔥视频教程</el-link>-->
|
||||
<!-- <el-link href="https://www.iocoder.cn/Interview/good-collection/" target="_blank">-->
|
||||
<!-- ⚡面试手册-->
|
||||
<!-- </el-link>-->
|
||||
<!-- <el-link href="http://static.yudao.iocoder.cn/mp/Aix9975.jpeg" target="_blank">-->
|
||||
<!-- 🤝外包咨询-->
|
||||
<!-- </el-link>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
|
@ -273,7 +273,7 @@ const handleLogin = async (params) => {
|
|||
if (redirect.value.indexOf('sso') !== -1) {
|
||||
window.location.href = window.location.href.replace('/login?redirect=', '')
|
||||
} else {
|
||||
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
||||
await push({path: redirect.value || permissionStore.getAddRouters[0].path})
|
||||
}
|
||||
} finally {
|
||||
loginLoading.value = false
|
||||
|
|
@ -283,39 +283,44 @@ const handleLogin = async (params) => {
|
|||
|
||||
// 社交登录
|
||||
const doSocialLogin = async (type: number) => {
|
||||
if (type === 0) {
|
||||
message.error('此方式未配置')
|
||||
} else {
|
||||
loginLoading.value = true
|
||||
if (loginData.tenantEnable === 'true') {
|
||||
// 尝试先通过 tenantName 获取租户
|
||||
await getTenantId()
|
||||
// 如果获取不到,则需要弹出提示,进行处理
|
||||
if (!authUtil.getTenantId()) {
|
||||
try {
|
||||
const data = await message.prompt('请输入租户名称', t('common.reminder'))
|
||||
if (data?.action !== 'confirm') throw 'cancel'
|
||||
const res = await LoginApi.getTenantIdByName(data.value)
|
||||
authUtil.setTenantId(res)
|
||||
} catch (error) {
|
||||
if (error === 'cancel') return
|
||||
} finally {
|
||||
loginLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
// 计算 redirectUri
|
||||
// tricky: type、redirect需要先encode一次,否则钉钉回调会丢失。
|
||||
// 配合 Login/SocialLogin.vue#getUrlValue() 使用
|
||||
const redirectUri =
|
||||
location.origin +
|
||||
'/social-login?' +
|
||||
encodeURIComponent(`type=${type}&redirect=${redirect.value || '/'}`)
|
||||
|
||||
// 进行跳转
|
||||
const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri))
|
||||
window.location.href = res
|
||||
}
|
||||
ElMessage({
|
||||
message: '功能正在开发中,敬请期待',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
})
|
||||
// if (type === 0) {
|
||||
// message.error('此方式未配置')
|
||||
// } else {
|
||||
// loginLoading.value = true
|
||||
// if (loginData.tenantEnable === 'true') {
|
||||
// // 尝试先通过 tenantName 获取租户
|
||||
// await getTenantId()
|
||||
// // 如果获取不到,则需要弹出提示,进行处理
|
||||
// if (!authUtil.getTenantId()) {
|
||||
// try {
|
||||
// const data = await message.prompt('请输入租户名称', t('common.reminder'))
|
||||
// if (data?.action !== 'confirm') throw 'cancel'
|
||||
// const res = await LoginApi.getTenantIdByName(data.value)
|
||||
// authUtil.setTenantId(res)
|
||||
// } catch (error) {
|
||||
// if (error === 'cancel') return
|
||||
// } finally {
|
||||
// loginLoading.value = false
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // 计算 redirectUri
|
||||
// // tricky: type、redirect需要先encode一次,否则钉钉回调会丢失。
|
||||
// // 配合 Login/SocialLogin.vue#getUrlValue() 使用
|
||||
// const redirectUri =
|
||||
// location.origin +
|
||||
// '/social-login?' +
|
||||
// encodeURIComponent(`type=${type}&redirect=${redirect.value || '/'}`)
|
||||
//
|
||||
// // 进行跳转
|
||||
// const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri))
|
||||
// window.location.href = res
|
||||
// }
|
||||
}
|
||||
watch(
|
||||
() => currentRoute.value,
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ const signIn = async () => {
|
|||
if (!redirect.value) {
|
||||
redirect.value = '/'
|
||||
}
|
||||
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
||||
push({ path: redirect.value || permissionStore.getAddRouters[0].path })
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue