yangyin
2024-11-14 e2b2d9175832558abc80a5a0d4cc2278d0665cf9
修改新手指导
已修改2个文件
24 ■■■■■ 文件已修改
src/layout/component/sidebar/components/MenuList.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/chatRoom.ts 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/component/sidebar/components/MenuList.vue
@@ -37,7 +37,7 @@
            </div>
        </div>
    </div>
    <div class="pc-login items-center justify-center" style="display: flex" v-show="state.isShowLogin">
    <div class="pc-login items-center justify-center" style="display: flex" v-show="isShowLogin">
        <div class="login_box">
            <div class="sign_in">
                <i class="ywifont ywicon-guanbi closes" @click="handleClose"></i>
@@ -96,11 +96,11 @@
import { computed, onMounted, reactive, ref, watchEffect } from 'vue';
import { PostLogin, loginMessageUser, loginVerifyMessage } from '/@/api/ai/user';
import router from '/@/router';
import { isSharePage, isShowLogin } from '/@/stores/chatRoom';
import emitter from '/@/utils/mitt';
import { accessSessionKey, userNameKey } from '/@/utils/request';
import { gotoRoute } from '/@/utils/route';
import { Local, LoginInfo } from '/@/utils/storage';
import { isSharePage } from '/@/stores/chatRoom';
const loginFormRef = ref<FormInstance>(null); //账户密码登录
const formPhoneRef = ref(); //手机号登录
const isLoginStatus = ref(!!Local.get(accessSessionKey));
@@ -137,7 +137,6 @@
            routerName: 'AboutUs',
        },
    ],
    isShowLogin: false,
    isShowExitLogin: false,
    loginForm: {
        account: '',
@@ -170,10 +169,10 @@
const openLoginDlg = async () => {
    // 分享页不需要
    if (isSharePage.value) return;
    state.isShowLogin = true;
    isShowLogin.value = true;
};
const handleClose = () => {
    state.isShowLogin = false;
    isShowLogin.value = false;
};
const hasSended = computed(() => {
    return countdown.value !== null;
@@ -212,7 +211,7 @@
        LoginInfo.set(res.hswatersession, state.loginPhoneForm.phoneUser);
    }
    state.isShowLogin = false;
    isShowLogin.value = false;
    isLoginStatus.value = true;
    window.location.reload();
};
@@ -265,7 +264,7 @@
};
onMounted(() => {
    emitter.on('openLoginDlg', () => {
        if (state.isShowLogin || isLoginStatus.value) return;
        if (isShowLogin.value || isLoginStatus.value) return;
        openLoginDlg();
    });
src/stores/chatRoom.ts
@@ -69,7 +69,7 @@
 * 全局使用的 ref
 */
export const sectionAList = ref([]);
export const isShowLogin = ref(false);
//#region ====================== 全局使用数据 ======================
// group 列表
export const sceneGroupList = ref([]);
@@ -130,15 +130,11 @@
/** @description 聊天室展示模式 */
// export const chatDisplayMode = ref<ChatMode>('default');
export const SHARE_PAGE_NAME = 'ShareAnswer'
export const SHARE_PAGE_NAME = 'ShareAnswer';
export const isSharePage = computed(() => {
    const isShare = router.currentRoute.value.name === SHARE_PAGE_NAME;
    return isShare;
});
export const newChatRoomClick = async () => {
    const res = await CreateHistoryGroup({
@@ -175,5 +171,4 @@
            },
        });
    }
};
};