登录页面修改

pull/653/head
hky 2024-12-23 11:45:00 +08:00
parent ecfe1b6145
commit 5e2ce9461f
7 changed files with 7170 additions and 5831 deletions

8
.env
View File

@ -1,5 +1,5 @@
# 标题 # 标题
VITE_APP_TITLE=芋道管理系统 VITE_APP_TITLE=人力资源系统
# 项目本地运行端口号 # 项目本地运行端口号
VITE_PORT=80 VITE_PORT=80
@ -20,6 +20,6 @@ VITE_APP_DOCALERT_ENABLE=true
VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc
# 默认账户密码 # 默认账户密码
VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码 VITE_APP_DEFAULT_LOGIN_TENANT = 阿克苏塔里木农村商业银行股份有限公司
VITE_APP_DEFAULT_LOGIN_USERNAME = admin VITE_APP_DEFAULT_LOGIN_USERNAME =
VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123 VITE_APP_DEFAULT_LOGIN_PASSWORD =

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

View File

@ -5,7 +5,7 @@
<el-avatar :size="60"> <el-avatar :size="60">
<Icon icon="ep:avatar" :size="60" /> <Icon icon="ep:avatar" :size="60" />
</el-avatar> </el-avatar>
<span class="text-18px font-bold">芋道源码</span> <span class="text-18px font-bold">人力资源系统</span>
</div> </div>
<Icon icon="tdesign:qrcode" :size="20" /> <Icon icon="tdesign:qrcode" :size="20" />
</div> </div>

View File

@ -198,9 +198,9 @@ const loginData = reactive({
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE !== 'false', captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE !== 'false',
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE !== 'false', tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE !== 'false',
loginForm: { loginForm: {
tenantName: '芋道源码', tenantName: '人力资源系统',
username: 'admin', username: '',
password: 'admin123', password: '',
captchaVerification: '', captchaVerification: '',
rememberMe: false rememberMe: false
} }

View File

@ -82,64 +82,64 @@
mode="pop" mode="pop"
@success="handleLogin" @success="handleLogin"
/> />
<el-col :span="24" style="padding-right: 10px; padding-left: 10px"> <!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">-->
<el-form-item> <!-- <el-form-item>-->
<el-row :gutter="5" justify="space-between" style="width: 100%"> <!-- <el-row :gutter="5" justify="space-between" style="width: 100%">-->
<el-col :span="8"> <!-- <el-col :span="8">-->
<XButton <!-- <XButton-->
:title="t('login.btnMobile')" <!-- :title="t('login.btnMobile')"-->
class="w-[100%]" <!-- class="w-[100%]"-->
@click="setLoginState(LoginStateEnum.MOBILE)" <!-- @click="setLoginState(LoginStateEnum.MOBILE)"-->
/> <!-- />-->
</el-col> <!-- </el-col>-->
<el-col :span="8"> <!-- <el-col :span="8">-->
<XButton <!-- <XButton-->
:title="t('login.btnQRCode')" <!-- :title="t('login.btnQRCode')"-->
class="w-[100%]" <!-- class="w-[100%]"-->
@click="setLoginState(LoginStateEnum.QR_CODE)" <!-- @click="setLoginState(LoginStateEnum.QR_CODE)"-->
/> <!-- />-->
</el-col> <!-- </el-col>-->
<el-col :span="8"> <!-- <el-col :span="8">-->
<XButton <!-- <XButton-->
:title="t('login.btnRegister')" <!-- :title="t('login.btnRegister')"-->
class="w-[100%]" <!-- class="w-[100%]"-->
@click="setLoginState(LoginStateEnum.REGISTER)" <!-- @click="setLoginState(LoginStateEnum.REGISTER)"-->
/> <!-- />-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider> <!-- <el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider>-->
<el-col :span="24" style="padding-right: 10px; padding-left: 10px"> <!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">-->
<el-form-item> <!-- <el-form-item>-->
<div class="w-[100%] flex justify-between"> <!-- <div class="w-[100%] flex justify-between">-->
<Icon <!-- <Icon-->
v-for="(item, key) in socialList" <!-- v-for="(item, key) in socialList"-->
:key="key" <!-- :key="key"-->
:icon="item.icon" <!-- :icon="item.icon"-->
:size="30" <!-- :size="30"-->
class="anticon cursor-pointer" <!-- class="anticon cursor-pointer"-->
color="#999" <!-- color="#999"-->
@click="doSocialLogin(item.type)" <!-- @click="doSocialLogin(item.type)"-->
/> <!-- />-->
</div> <!-- </div>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-divider content-position="center">萌新必读</el-divider> <!-- <el-divider content-position="center">萌新必读</el-divider>-->
<el-col :span="24" style="padding-right: 10px; padding-left: 10px"> <!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">-->
<el-form-item> <!-- <el-form-item>-->
<div class="w-[100%] flex justify-between"> <!-- <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/" target="_blank">📚开发指南</el-link>-->
<el-link href="https://doc.iocoder.cn/video/" 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 href="https://www.iocoder.cn/Interview/good-collection/" target="_blank">-->
面试手册 <!-- 面试手册-->
</el-link> <!-- </el-link>-->
<el-link href="http://static.yudao.iocoder.cn/mp/Aix9975.jpeg" target="_blank"> <!-- <el-link href="http://static.yudao.iocoder.cn/mp/Aix9975.jpeg" target="_blank">-->
🤝外包咨询 <!-- 🤝外包咨询-->
</el-link> <!-- </el-link>-->
</div> <!-- </div>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
@ -273,7 +273,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 }) await push({path: redirect.value || permissionStore.getAddRouters[0].path})
} }
} finally { } finally {
loginLoading.value = false loginLoading.value = false
@ -283,39 +283,44 @@ const handleLogin = async (params) => {
// //
const doSocialLogin = async (type: number) => { const doSocialLogin = async (type: number) => {
if (type === 0) { ElMessage({
message.error('此方式未配置') message: '功能正在开发中,敬请期待',
} else { type: 'success',
loginLoading.value = true plain: true,
if (loginData.tenantEnable === 'true') { })
// tenantName // if (type === 0) {
await getTenantId() // message.error('')
// // } else {
if (!authUtil.getTenantId()) { // loginLoading.value = true
try { // if (loginData.tenantEnable === 'true') {
const data = await message.prompt('请输入租户名称', t('common.reminder')) // // tenantName
if (data?.action !== 'confirm') throw 'cancel' // await getTenantId()
const res = await LoginApi.getTenantIdByName(data.value) // //
authUtil.setTenantId(res) // if (!authUtil.getTenantId()) {
} catch (error) { // try {
if (error === 'cancel') return // const data = await message.prompt('', t('common.reminder'))
} finally { // if (data?.action !== 'confirm') throw 'cancel'
loginLoading.value = false // const res = await LoginApi.getTenantIdByName(data.value)
} // authUtil.setTenantId(res)
} // } catch (error) {
} // if (error === 'cancel') return
// redirectUri // } finally {
// tricky: typeredirectencode // loginLoading.value = false
// Login/SocialLogin.vue#getUrlValue() 使 // }
const redirectUri = // }
location.origin + // }
'/social-login?' + // // redirectUri
encodeURIComponent(`type=${type}&redirect=${redirect.value || '/'}`) // // tricky: typeredirectencode
// // Login/SocialLogin.vue#getUrlValue() 使
// // const redirectUri =
const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri)) // location.origin +
window.location.href = res // '/social-login?' +
} // encodeURIComponent(`type=${type}&redirect=${redirect.value || '/'}`)
//
// //
// const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri))
// window.location.href = res
// }
} }
watch( watch(
() => currentRoute.value, () => currentRoute.value,

View File

@ -200,7 +200,7 @@ const signIn = async () => {
if (!redirect.value) { if (!redirect.value) {
redirect.value = '/' redirect.value = '/'
} }
push({ path: redirect.value || permissionStore.addRouters[0].path }) push({ path: redirect.value || permissionStore.getAddRouters[0].path })
}) })
.catch(() => {}) .catch(() => {})
.finally(() => { .finally(() => {