优化网站导航模块
This commit is contained in:
@@ -87,7 +87,11 @@
|
||||
import type { StepForm } from '../model';
|
||||
import { assignObject, phoneReg } from 'ele-admin-pro';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { getCaptcha, sendSmsCaptcha, registerUser } from '@/api/login';
|
||||
import {
|
||||
getCaptcha,
|
||||
sendSmsCaptcha,
|
||||
registerUser
|
||||
} from '@/api/passport/login';
|
||||
import { User } from '@/api/system/user/model';
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -5,14 +5,22 @@
|
||||
['', 'login-form-right', 'login-form-left'][direction]
|
||||
]"
|
||||
:style="{
|
||||
backgroundImage: 'url(' + param.login_bg_img + ')'
|
||||
backgroundImage: 'url(' + config?.loginBgImg + ')'
|
||||
}"
|
||||
>
|
||||
<div class="logo-login" v-if="config.shortName">
|
||||
<img :src="config.companyLogo" class="logo" />
|
||||
<h4>{{ config.shortName }}</h4>
|
||||
<div class="logo-login" v-if="config?.siteName">
|
||||
<img
|
||||
:src="
|
||||
config.sysLogo ||
|
||||
'https://oss.wsdns.cn/20240822/0252ad4ed46449cdafe12f8d3d96c2ea.svg'
|
||||
"
|
||||
class="logo"
|
||||
/>
|
||||
<h4>{{ config.siteName }}</h4>
|
||||
</div>
|
||||
<div class="company-name">{{ param.login_name }}</div>
|
||||
<div class="company-name" v-if="config?.loginTitle">{{
|
||||
config?.loginTitle
|
||||
}}</div>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
@@ -154,11 +162,10 @@
|
||||
</template>
|
||||
</a-form>
|
||||
<div class="login-copyright">
|
||||
<p>
|
||||
copyright © {{ new Date().getFullYear() }}
|
||||
{{ config.companyName ? config.companyName : 'Websoft Inc.' }} All
|
||||
Rights Reserved.
|
||||
</p>
|
||||
<a-space>
|
||||
<span>© {{ new Date().getFullYear() }}</span>
|
||||
<span>{{ config?.copyright || 'websoft.top Inc.' }}</span>
|
||||
</a-space>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
<a-modal
|
||||
@@ -209,27 +216,16 @@
|
||||
|
||||
import { User } from '@/api/system/user/model';
|
||||
import { THEME_STORE_NAME } from '@/config/setting';
|
||||
import { sendSmsCaptcha } from '@/api/login';
|
||||
import { useTenantStore } from '@/store/modules/tenant';
|
||||
import { Company } from '@/api/system/company/model';
|
||||
import { sendSmsCaptcha } from '@/api/passport/login';
|
||||
import useFormData from '@/utils/use-form-data';
|
||||
// import { openUrl } from '@/utils/common';
|
||||
// import { getDomain } from '@/utils/domain';
|
||||
// import { getMerchantAccountByPhone } from '@/api/shop/merchantAccount';
|
||||
// import {
|
||||
// addBatchChatMessage,
|
||||
// addChatMessage,
|
||||
// updateChatMessage
|
||||
// } from '@/api/system/chatMessage';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { listWebsiteField } from '@/api/system/website/field';
|
||||
import { WebsiteParam } from '@/api/cms/website/field/model';
|
||||
import { configWebsiteField } from '@/api/system/website/field';
|
||||
import { Config } from '@/api/cms/website/field/model';
|
||||
import { phoneReg } from 'ele-admin-pro';
|
||||
|
||||
const useForm = Form.useForm;
|
||||
const { currentRoute } = useRouter();
|
||||
const { t } = useI18n();
|
||||
const tenantStore = useTenantStore();
|
||||
|
||||
// 登录框方向, 0 居中, 1 居右, 2 居左
|
||||
const direction = ref(0);
|
||||
@@ -238,7 +234,7 @@
|
||||
// 是否显示tenantId填写输入框
|
||||
const showTenantId = ref(true);
|
||||
const loginType = ref('account');
|
||||
const param = ref<WebsiteParam>({});
|
||||
const config = ref<Config>();
|
||||
// 配置信息
|
||||
const { form } = useFormData<User>({
|
||||
username: '',
|
||||
@@ -249,13 +245,7 @@
|
||||
remember: true,
|
||||
isAdmin: true
|
||||
});
|
||||
// 表单数据
|
||||
const config = reactive<Company>({
|
||||
shortName: '',
|
||||
companyName: '',
|
||||
companyLogo: '',
|
||||
tenantId: undefined
|
||||
});
|
||||
|
||||
// 验证码 base64 数据
|
||||
const captcha = ref('');
|
||||
// 验证码内容, 实际项目去掉
|
||||
@@ -270,7 +260,7 @@
|
||||
const countdownTime = ref(0);
|
||||
// 验证码倒计时定时器
|
||||
let countdownTimer: number | null = null;
|
||||
const tenantId = getTenantId();
|
||||
const tenantId = getTenantId();
|
||||
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
@@ -451,11 +441,8 @@
|
||||
|
||||
/* 获取图形验证码 */
|
||||
const changeCaptcha = () => {
|
||||
listWebsiteField({}).then((list) => {
|
||||
list.map((d) => {
|
||||
const key = String(d.name);
|
||||
param.value[key] = d.value;
|
||||
});
|
||||
configWebsiteField({}).then((data) => {
|
||||
config.value = data;
|
||||
});
|
||||
// 这里演示的验证码是后端返回base64格式的形式, 如果后端地址直接是图片请参考忘记密码页面
|
||||
getCaptcha()
|
||||
@@ -485,15 +472,6 @@
|
||||
form.tenantId = Number(tenantId);
|
||||
showTenantId.value = false;
|
||||
}
|
||||
// 获取租户信息
|
||||
const { company } = tenantStore;
|
||||
if (company) {
|
||||
config.companyName = company.companyName;
|
||||
config.companyLogo = company.companyLogo;
|
||||
config.shortName = company.shortName;
|
||||
config.tenantId = company.tenantId;
|
||||
config.domain = company.domain;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user