no message
This commit is contained in:
parent
ea51cee22a
commit
4b75ebf647
@ -1,7 +1,7 @@
|
||||
MP_API_BASE_URL=https://patient.youcan365.com
|
||||
MP_IMAGE_URL=https://patient.youcan365.com
|
||||
MP_CACHE_PREFIX=development
|
||||
MP_WX_APP_ID=wx6ee11733526b4f04
|
||||
MP_WX_APP_ID=wx1d8337a40c11d66c
|
||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||
MP_TIM_SDK_APP_ID=1600123876
|
||||
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||
|
||||
2
.env.ip
2
.env.ip
@ -1,7 +1,7 @@
|
||||
MP_API_BASE_URL=http://192.168.60.2:8080
|
||||
MP_IMAGE_URL=https://patient.youcan365.com
|
||||
MP_CACHE_PREFIX=development
|
||||
MP_WX_APP_ID=wx6ee11733526b4f04
|
||||
MP_WX_APP_ID=wx1d8337a40c11d66c
|
||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||
MP_TIM_SDK_APP_ID=1600123876
|
||||
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
MP_API_BASE_URL=http://localhost:8080
|
||||
MP_IMAGE_URL=https://patient.youcan365.com
|
||||
MP_CACHE_PREFIX=development
|
||||
MP_WX_APP_ID=wx6ee11733526b4f04
|
||||
MP_WX_APP_ID=wx1d8337a40c11d66c
|
||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||
MP_TIM_SDK_APP_ID=1600123876
|
||||
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||
|
||||
19
App.vue
19
App.vue
@ -5,18 +5,21 @@ import { globalTimChatManager } from "@/utils/tim-chat.js";
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
// 需在 pinia 安装后再获取 store,避免 getActivePinia 报错
|
||||
const { account, login, initIMAfterLogin } = useAccountStore();
|
||||
const { account, login, initIMAfterLogin, getDoctorInfo } =
|
||||
useAccountStore();
|
||||
|
||||
// 如果已有缓存的账户信息,尝试初始化 IM,否则重新登录
|
||||
debugger;
|
||||
if (account && account.openid) {
|
||||
console.log("App Launch: 已有登录信息,初始化 IM");
|
||||
initIMAfterLogin().catch(err => {
|
||||
console.error('IM初始化失败:', err);
|
||||
initIMAfterLogin().catch((err) => {
|
||||
console.error("IM初始化失败:", err);
|
||||
});
|
||||
getDoctorInfo();
|
||||
} else {
|
||||
console.log("App Launch: 无登录信息,开始登录");
|
||||
login().catch(err => {
|
||||
console.error('自动登录失败:', err);
|
||||
login().catch((err) => {
|
||||
console.error("自动登录失败:", err);
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -40,7 +43,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
$primary-color: #0877F1;
|
||||
$primary-color: #0877f1;
|
||||
|
||||
page {
|
||||
height: 100%;
|
||||
@ -82,7 +85,7 @@ uni-button[type="primary"]:not([disabled]):active {
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
.absolute{
|
||||
.absolute {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@ -159,7 +162,7 @@ uni-button[type="primary"]:not([disabled]):active {
|
||||
}
|
||||
|
||||
.bg-light-text-color::after {
|
||||
content: '';
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
@ -41,6 +41,7 @@ export default defineStore("accountStore", () => {
|
||||
|
||||
async function loginByCode(phoneCode = '') {
|
||||
try {
|
||||
debugger
|
||||
const { code } = await uni.login({
|
||||
appid,
|
||||
provider: "weixin",
|
||||
@ -82,13 +83,16 @@ export default defineStore("accountStore", () => {
|
||||
|
||||
async function getDoctorInfo(data = {}) {
|
||||
try {
|
||||
debugger
|
||||
const res = await api('getCorpMemberData', {
|
||||
...data,
|
||||
weChatOpenId: account.value.openid,
|
||||
});
|
||||
doctorInfo.value = res?.data || null;
|
||||
|
||||
// 持久化医生信息
|
||||
if (doctorInfo.value.accountState && doctorInfo.value.accountState == "disable") {
|
||||
uni.redirectTo({ url: "/pages/login/login" });
|
||||
return;
|
||||
}
|
||||
if (res?.data) {
|
||||
cache.set(CACHE_KEYS.DOCTOR_INFO, res.data);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user