feat: 跳转链接带二维码

This commit is contained in:
renxiaodong
2025-06-23 01:46:41 -04:00
parent b3d33600c0
commit 9c8d5ba8d0
4 changed files with 15 additions and 10 deletions

View File

@ -1,3 +1,7 @@
<!--
* @Author: RenXiaoDong
* @Date: 2025-06-22 22:15:28
-->
<template>
<Modal title="加入企业" @ok="handleJoin">
<div v-if="enterprise" class="join-body flex item-center">
@ -18,7 +22,8 @@ const inviteCode = ref();
async function getEnterprise() {
inviteCode.value = getQueryParam('invite_code');
if (inviteCode.value) {
enterprise.value = await getEnterpriseByInviteCode(inviteCode.value);
const res = await getEnterpriseByInviteCode(inviteCode.value);
enterprise.value = res.data;
}
}

View File

@ -2,7 +2,7 @@
* @Author: 田鑫
* @Date: 2023-03-05 18:14:17
* @LastEditors: Please set LastEditors
* @LastEditTime: 2025-06-22 22:46:01
* @LastEditTime: 2025-06-23 01:39:50
* @Description:
*/
import { createRouter, createWebHistory } from 'vue-router';
@ -20,7 +20,7 @@ const router = createRouter({
routes: [
{
path: '/login',
name: 'login',
name: 'UserLogin',
component: () => import('@/views/components/login'),
},
{
@ -33,7 +33,7 @@ const router = createRouter({
},
{
path: '/',
name: 'dataEngine',
name: 'Home',
redirect: '/dataEngine/dataEngine/hotTranslation',
children: [...appRoutes, REDIRECT_MAIN, NOT_FOUND_ROUTE],
},

View File

@ -16,8 +16,6 @@ export async function handleUserLogin() {
handleUserHome();
}
// 首页
export function handleUserHome() {
router.push({ name: 'Home' });

View File

@ -42,7 +42,7 @@
</div>
<div v-else class="add-account-container">
<h2 class="cannot-add-account-title flex item-center">
<img src="@/assets/warning.svg" alt="">
<img src="@/assets/warning.svg" alt="" />
当前可用子账号数为0
</h2>
<p class="cannot-add-account-subtitle">如需添加更多子账号您可联系销售人员进行购买和权限扩展</p>
@ -124,15 +124,17 @@ function handlePageSizeChange(pageSize: number) {
async function getSubAccount() {
const res = await fetchSubAccountPage(params);
pagination.total = res.total;
data.value = res.data;
const { data, total } = res.data;
pagination.total = total;
data.value = data;
}
async function handleAddAccount() {
if (canAddAccount.value) {
const res = await getEnterpriseInviteCode();
const port = window.location.port === '' ? '' : ':' + window.location.port;
const domain = window.location.protocol + '//' + window.location.hostname + port;
inviteUrl.value = domain + '?invite_code=' + res.invite_code;
inviteUrl.value = domain + '?invite_code=' + res.data?.invite_code;
}
addAccountVisible.value = true;
}