Merge remote-tracking branch 'origin/ai-hub' into ai-hub
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
"ComputedRef": true,
|
"ComputedRef": true,
|
||||||
"DirectiveBinding": true,
|
"DirectiveBinding": true,
|
||||||
"EffectScope": true,
|
"EffectScope": true,
|
||||||
|
"ElMessage": true,
|
||||||
|
"ElMessageBox": true,
|
||||||
"ExtractDefaultPropTypes": true,
|
"ExtractDefaultPropTypes": true,
|
||||||
"ExtractPropTypes": true,
|
"ExtractPropTypes": true,
|
||||||
"ExtractPublicPropTypes": true,
|
"ExtractPublicPropTypes": true,
|
||||||
|
|||||||
@@ -189,23 +189,28 @@ function stopPolling() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 刷新二维码 */
|
/** 刷新二维码 */
|
||||||
async function handleRefresh() {
|
// async function handleRefresh() {
|
||||||
isExpired.value = false;
|
// isExpired.value = false;
|
||||||
isQrCodeError.value = false;
|
// isQrCodeError.value = false;
|
||||||
isScanned.value = false;
|
// isScanned.value = false;
|
||||||
isConfirming.value = false;
|
// isConfirming.value = false;
|
||||||
stopPolling();
|
// stopPolling();
|
||||||
|
//
|
||||||
|
// const success = await fetchQRCodeInfo();
|
||||||
|
// if (success) {
|
||||||
|
// qrStart(shallowRef(600));
|
||||||
|
// startStatusPolling();
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// isQrCodeError.value = true;
|
||||||
|
// stopPolling();
|
||||||
|
// ElMessage.error('刷新二维码失败');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
const success = await fetchQRCodeInfo();
|
/** 刷新二维码按钮 */
|
||||||
if (success) {
|
async function handleRefresh() {
|
||||||
qrStart(shallowRef(600));
|
await initQRCode();
|
||||||
startStatusPolling();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
isQrCodeError.value = true;
|
|
||||||
stopPolling();
|
|
||||||
ElMessage.error('刷新二维码失败');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 启动状态轮询 */
|
/** 启动状态轮询 */
|
||||||
@@ -221,17 +226,41 @@ function startStatusPolling() {
|
|||||||
|
|
||||||
/** 组件初始化 */
|
/** 组件初始化 */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
await initQRCode();
|
||||||
|
// const success = await fetchQRCodeInfo();
|
||||||
|
// if (success) {
|
||||||
|
// qrStart();
|
||||||
|
// startStatusPolling();
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// isQrCodeError.value = true;
|
||||||
|
// stopPolling();
|
||||||
|
// ElMessage.error('初始化二维码失败');
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
|
||||||
|
/** 初始化或刷新二维码 */
|
||||||
|
async function initQRCode() {
|
||||||
|
// 清理旧的定时器和轮询
|
||||||
|
qrStop();
|
||||||
|
confirmStop();
|
||||||
|
stopPolling();
|
||||||
|
|
||||||
const success = await fetchQRCodeInfo();
|
const success = await fetchQRCodeInfo();
|
||||||
if (success) {
|
if (success) {
|
||||||
qrStart();
|
isExpired.value = false;
|
||||||
startStatusPolling();
|
isQrCodeError.value = false;
|
||||||
|
isScanned.value = false;
|
||||||
|
isConfirming.value = false;
|
||||||
|
|
||||||
|
qrStart(); // 重新开始倒计时
|
||||||
|
startStatusPolling(); // 开始轮询
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
isQrCodeError.value = true;
|
isQrCodeError.value = true;
|
||||||
stopPolling();
|
ElMessage.error('获取二维码失败');
|
||||||
ElMessage.error('初始化二维码失败');
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
/** 组件卸载清理 */
|
/** 组件卸载清理 */
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const loginFormType = computed(() => loginFromStore.LoginFormType);
|
|||||||
// 使用 defineModel 定义双向绑定的 visible(需 Vue 3.4+)
|
// 使用 defineModel 定义双向绑定的 visible(需 Vue 3.4+)
|
||||||
const visible = defineModel<boolean>('visible');
|
const visible = defineModel<boolean>('visible');
|
||||||
const showMask = ref(false); // 控制遮罩层显示的独立状态
|
const showMask = ref(false); // 控制遮罩层显示的独立状态
|
||||||
const isQrMode = ref(true);
|
const isQrMode = ref(false);
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const sessionStore = useSessionStore();
|
const sessionStore = useSessionStore();
|
||||||
@@ -56,6 +56,8 @@ function handleMaskClick() {
|
|||||||
// 过渡动画结束回调
|
// 过渡动画结束回调
|
||||||
function onAfterLeave() {
|
function onAfterLeave() {
|
||||||
if (!visible.value) {
|
if (!visible.value) {
|
||||||
|
isQrMode.value = false;
|
||||||
|
|
||||||
showMask.value = false; // 动画结束后隐藏遮罩
|
showMask.value = false; // 动画结束后隐藏遮罩
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
Yi.Ai.Vue3/types/components.d.ts
vendored
30
Yi.Ai.Vue3/types/components.d.ts
vendored
@@ -11,6 +11,33 @@ declare module 'vue' {
|
|||||||
AccountPassword: typeof import('./../src/components/LoginDialog/components/FormLogin/AccountPassword.vue')['default']
|
AccountPassword: typeof import('./../src/components/LoginDialog/components/FormLogin/AccountPassword.vue')['default']
|
||||||
APIKeyManagement: typeof import('./../src/components/userPersonalCenter/components/APIKeyManagement.vue')['default']
|
APIKeyManagement: typeof import('./../src/components/userPersonalCenter/components/APIKeyManagement.vue')['default']
|
||||||
DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default']
|
DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default']
|
||||||
|
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||||
|
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||||
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
|
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||||
|
ElCard: typeof import('element-plus/es')['ElCard']
|
||||||
|
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||||
|
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||||
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||||
|
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
||||||
|
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
|
||||||
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
|
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||||
|
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
||||||
|
ElForm: typeof import('element-plus/es')['ElForm']
|
||||||
|
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||||
|
ElHeader: typeof import('element-plus/es')['ElHeader']
|
||||||
|
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||||
|
ElImage: typeof import('element-plus/es')['ElImage']
|
||||||
|
ElInput: typeof import('element-plus/es')['ElInput']
|
||||||
|
ElMain: typeof import('element-plus/es')['ElMain']
|
||||||
|
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||||
|
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||||
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||||
|
ElTable: typeof import('element-plus/es')['ElTable']
|
||||||
|
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||||
|
ElTag: typeof import('element-plus/es')['ElTag']
|
||||||
|
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||||
FilesSelect: typeof import('./../src/components/FilesSelect/index.vue')['default']
|
FilesSelect: typeof import('./../src/components/FilesSelect/index.vue')['default']
|
||||||
IconSelect: typeof import('./../src/components/IconSelect/index.vue')['default']
|
IconSelect: typeof import('./../src/components/IconSelect/index.vue')['default']
|
||||||
Indexl: typeof import('./../src/components/SupportModelProducts/indexl.vue')['default']
|
Indexl: typeof import('./../src/components/SupportModelProducts/indexl.vue')['default']
|
||||||
@@ -32,4 +59,7 @@ declare module 'vue' {
|
|||||||
VerificationCode: typeof import('./../src/components/LoginDialog/components/FormLogin/VerificationCode.vue')['default']
|
VerificationCode: typeof import('./../src/components/LoginDialog/components/FormLogin/VerificationCode.vue')['default']
|
||||||
WelecomeText: typeof import('./../src/components/WelecomeText/index.vue')['default']
|
WelecomeText: typeof import('./../src/components/WelecomeText/index.vue')['default']
|
||||||
}
|
}
|
||||||
|
export interface GlobalDirectives {
|
||||||
|
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user