no message
This commit is contained in:
parent
0ec3e570af
commit
bf6106184d
@ -11,7 +11,7 @@ import api from "@/utils/api";
|
|||||||
import { set } from "@/utils/cache";
|
import { set } from "@/utils/cache";
|
||||||
import { toast } from "@/utils/widget";
|
import { toast } from "@/utils/widget";
|
||||||
import useAccountStore from "@/store/account";
|
import useAccountStore from "@/store/account";
|
||||||
import { normalizeCorpId, normalizeCorpIdFields } from "@/utils/api-base-config";
|
import { isSh6CorpId, normalizeCorpId, normalizeCorpIdFields, resolveApiContext } from "@/utils/api-base-config";
|
||||||
|
|
||||||
const env = __VITE_ENV__;
|
const env = __VITE_ENV__;
|
||||||
const appid = env.MP_WX_APP_ID;
|
const appid = env.MP_WX_APP_ID;
|
||||||
@ -81,7 +81,12 @@ function getAiConsultEntryUrl({ teamId, corpId, qrid }) {
|
|||||||
|
|
||||||
async function changeTeam({ teamId, corpId, corpUserId, externalUserId, qrid, referenceCustomerId, type }) {
|
async function changeTeam({ teamId, corpId, corpUserId, externalUserId, qrid, referenceCustomerId, type }) {
|
||||||
const normalizedCorpId = normalizeCorpId(corpId);
|
const normalizedCorpId = normalizeCorpId(corpId);
|
||||||
|
const requiresSession = isSh6CorpId(normalizedCorpId);
|
||||||
const redirectUrl = type === 'aiConsult' ? getAiConsultEntryUrl({ teamId, corpId: normalizedCorpId, qrid }) : '';
|
const redirectUrl = type === 'aiConsult' ? getAiConsultEntryUrl({ teamId, corpId: normalizedCorpId, qrid }) : '';
|
||||||
|
if (requiresSession) {
|
||||||
|
resolveApiContext(normalizedCorpId);
|
||||||
|
await login('', { forceVerify: true });
|
||||||
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await api("getTeamData", { teamId, corpId: normalizedCorpId, withCorpName: true });
|
const res = await api("getTeamData", { teamId, corpId: normalizedCorpId, withCorpName: true });
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@ -99,7 +104,7 @@ async function changeTeam({ teamId, corpId, corpUserId, externalUserId, qrid, re
|
|||||||
qrid,
|
qrid,
|
||||||
referenceCustomerId: referenceCustomerId || ''
|
referenceCustomerId: referenceCustomerId || ''
|
||||||
});
|
});
|
||||||
await login('', { forceVerify: true })
|
if (!requiresSession) await login('', { forceVerify: true })
|
||||||
if (account.value && account.value.mobile) {
|
if (account.value && account.value.mobile) {
|
||||||
bindTeam({ corpUserId, externalUserId, redirectUrl })
|
bindTeam({ corpUserId, externalUserId, redirectUrl })
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user