diff --git a/pages/archive/archive-result.vue b/pages/archive/archive-result.vue index 152a4fd..18cff2f 100644 --- a/pages/archive/archive-result.vue +++ b/pages/archive/archive-result.vue @@ -68,6 +68,7 @@ const { useLoad } = useGuard(); const { account } = storeToRefs(useAccount()); const { memberJob, memberList: list } = useJob(); const qrcode = ref(''); +const corpId = ref('') const friends = computed(() => { const memberList = Array.isArray(team.value?.memberList) ? team.value.memberList : []; @@ -84,11 +85,11 @@ function previewImage() { } function toFriend(userid) { - uni.navigateTo({ url: `/pages/team/friend?corpId=${account.value?.corpId}&userid=${userid}` }) + uni.navigateTo({ url: `/pages/team/friend?corpId=${corpId.value}&userid=${userid}` }) } async function getQrcode(userid) { - const res = await api('addContactWay', { corpUserId: userid, corpId: account.value?.corpId, unionid: account.value?.openid }); + const res = await api('addContactWay', { corpUserId: userid, corpId: corpId.value, unionid: account.value?.openid }); if (res && res.data) { qrcode.value = res.data; } @@ -104,6 +105,7 @@ async function getTeam(corpId, teamId) { } useLoad(options => { + corpId.value = options.corpId; if (options.teamId && options.corpId) { getTeam(options.corpId, options.teamId); } diff --git a/pages/archive/edit-archive.vue b/pages/archive/edit-archive.vue index a30dd4b..ea0dba7 100644 --- a/pages/archive/edit-archive.vue +++ b/pages/archive/edit-archive.vue @@ -168,9 +168,7 @@ async function init() { if (res.length > 0) { visible.value = true; } - if (!externalUserId.value) { - getExternalUserId(); - } + getExternalUserId(corpId.value); } await getBaseForm(); if (!customerId.value) { diff --git a/pages/article/article-cate-list.vue b/pages/article/article-cate-list.vue index 2898e0d..2f42808 100644 --- a/pages/article/article-cate-list.vue +++ b/pages/article/article-cate-list.vue @@ -56,9 +56,6 @@ import dayjs from "dayjs"; import api from "@/utils/api.js"; import EmptyData from "@/components/empty-data.vue"; -const env = __VITE_ENV__; -const defaultCorpId = env.MP_CORP_ID; - const corpId = ref(""); const enabledIds = ref([]); const tabs = ref([{ name: "全部", value: "" }]); @@ -261,7 +258,7 @@ function goToDetail(item) { } onLoad(async (options) => { - corpId.value = options?.corpId || defaultCorpId || ""; + corpId.value = options?.corpId || ""; enabledIds.value = parseIdsParam(options?.ids); activeCateId.value = ""; await loadEnabledArticles(); diff --git a/pages/article/article-detail.vue b/pages/article/article-detail.vue index c319ceb..5e1e900 100644 --- a/pages/article/article-detail.vue +++ b/pages/article/article-detail.vue @@ -40,6 +40,7 @@ const articleData = ref({ }); let articleId = ""; +const corpId = ref('') const markArticleRead = async () => { const unionid = account.value?.unionid; @@ -47,7 +48,7 @@ const markArticleRead = async () => { try { await api( "addArticleReadRecord", - { corpId: account.value?.corpId, articleId, unionid }, + { corpId: corpId.value, articleId, unionid }, false ); } catch (err) { @@ -90,7 +91,7 @@ const loadArticle = async () => { loading.value = true; error.value = ""; try { - const res = await api("getArticle", { id: articleId, corpId }); + const res = await api("getArticle", { id: articleId, corpId: corpId.value }); if (res.success && res.data) { // 格式化日期 @@ -120,6 +121,7 @@ const loadArticle = async () => { }; onLoad((options) => { + corpId.value = options.corpId; if (options.id) { articleId = options.id; markArticleRead(); diff --git a/pages/article/article-list.vue b/pages/article/article-list.vue index f38b23b..d7ef8bb 100644 --- a/pages/article/article-list.vue +++ b/pages/article/article-list.vue @@ -1,18 +1,14 @@