Compare commits
No commits in common. "c9483c48c179aa3bafcacd1a3d55c9222812399d" and "638a6f3c54a030b7ec191c54efbdc604bdcd6bf7" have entirely different histories.
c9483c48c1
...
638a6f3c54
@ -2,3 +2,4 @@ MP_API_BASE_URL=https://patient.youcan365.com
|
|||||||
MP_CACHE_PREFIX=development
|
MP_CACHE_PREFIX=development
|
||||||
MP_WX_APP_ID=wx6ee11733526b4f04
|
MP_WX_APP_ID=wx6ee11733526b4f04
|
||||||
MP_TIM_SDK_APP_ID=1600123876
|
MP_TIM_SDK_APP_ID=1600123876
|
||||||
|
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||||
|
|||||||
@ -2,3 +2,4 @@ MP_API_BASE_URL=http://localhost:8080
|
|||||||
MP_CACHE_PREFIX=development
|
MP_CACHE_PREFIX=development
|
||||||
MP_WX_APP_ID=wx6ee11733526b4f04
|
MP_WX_APP_ID=wx6ee11733526b4f04
|
||||||
MP_TIM_SDK_APP_ID=1600123876
|
MP_TIM_SDK_APP_ID=1600123876
|
||||||
|
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
MP_API_BASE_URL=https://ykt.youcan365.com
|
|
||||||
MP_CACHE_PREFIX=production
|
|
||||||
MP_WX_APP_ID=production
|
|
||||||
MP_TIM_SDK_APP_ID=1600123876
|
|
||||||
@ -27,12 +27,6 @@
|
|||||||
"env": {
|
"env": {
|
||||||
"UNI_PLATFORM": "mp-weixin"
|
"UNI_PLATFORM": "mp-weixin"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"pro": {
|
|
||||||
"title": "线上",
|
|
||||||
"env": {
|
|
||||||
"UNI_PLATFORM": "mp-weixin"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -30,6 +30,8 @@ import api from "@/utils/api.js";
|
|||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import useAccountStore from "@/store/account.js";
|
import useAccountStore from "@/store/account.js";
|
||||||
|
const env = __VITE_ENV__;
|
||||||
|
const corpId = env.MP_CORP_ID;
|
||||||
const { account } = storeToRefs(useAccountStore());
|
const { account } = storeToRefs(useAccountStore());
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const error = ref("");
|
const error = ref("");
|
||||||
@ -45,11 +47,7 @@ const markArticleRead = async () => {
|
|||||||
const unionid = account.value?.unionid;
|
const unionid = account.value?.unionid;
|
||||||
if (!unionid || !articleId) return;
|
if (!unionid || !articleId) return;
|
||||||
try {
|
try {
|
||||||
await api(
|
await api("addArticleReadRecord", { corpId, articleId, unionid }, false);
|
||||||
"addArticleReadRecord",
|
|
||||||
{ corpId: account.value?.corpId, articleId, unionid },
|
|
||||||
false
|
|
||||||
);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn("markArticleRead failed:", err?.message || err);
|
console.warn("markArticleRead failed:", err?.message || err);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ const env = __VITE_ENV__;
|
|||||||
|
|
||||||
export default defineStore("accountStore", () => {
|
export default defineStore("accountStore", () => {
|
||||||
const appid = env.MP_WX_APP_ID;
|
const appid = env.MP_WX_APP_ID;
|
||||||
|
const corpId = env.MP_CORP_ID;
|
||||||
const account = ref(null);
|
const account = ref(null);
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const isIMInitialized = ref(false);
|
const isIMInitialized = ref(false);
|
||||||
@ -26,7 +27,8 @@ export default defineStore("accountStore", () => {
|
|||||||
const res = await api('wxAppLogin', {
|
const res = await api('wxAppLogin', {
|
||||||
appId: appid,
|
appId: appid,
|
||||||
phoneCode,
|
phoneCode,
|
||||||
code
|
code,
|
||||||
|
corpId
|
||||||
});
|
});
|
||||||
loading.value = false
|
loading.value = false
|
||||||
if (res.success && res.data && res.data.mobile) {
|
if (res.success && res.data && res.data.mobile) {
|
||||||
@ -109,8 +111,6 @@ export default defineStore("accountStore", () => {
|
|||||||
const corpId = account.value?.corpId;
|
const corpId = account.value?.corpId;
|
||||||
const unionid = account.value?.unionid;
|
const unionid = account.value?.unionid;
|
||||||
const openid = account.value?.openid;
|
const openid = account.value?.openid;
|
||||||
console.clear()
|
|
||||||
console.log('corpId', corpId, ',unionid', unionid, ',openid', openid)
|
|
||||||
if (!(corpId && unionid && openid) || externalUserId.value) return;
|
if (!(corpId && unionid && openid) || externalUserId.value) return;
|
||||||
const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId }, false);
|
const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId }, false);
|
||||||
if (res && res.success && typeof res.data === 'string' && res.data.trim()) {
|
if (res && res.success && typeof res.data === 'string' && res.data.trim()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user