zhangxiao
2024-08-26 a4ca216c5b215f323b3c439b2f445dad72bbfce1
fix: 修改bug
4个文件已修改
27 ■■■■ 已修改文件
src/components/navbar/index.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/user/index.ts 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dmx/IntelligentAgent/components/agentConfig.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dmx/knowledgeLib/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/navbar/index.vue
@@ -150,7 +150,7 @@
            <img alt="avatar" :src="avatar" />
          </a-avatar>
          <template #content>
            <a-doption>
            <!-- <a-doption>
              <a-space @click="switchRoles">
                <icon-tag />
                <span>
@@ -173,7 +173,7 @@
                  {{ $t('messageBox.userSettings') }}
                </span>
              </a-space>
            </a-doption>
            </a-doption> -->
            <a-doption>
              <a-space @click="handleLogout">
                <icon-export />
@@ -185,6 +185,7 @@
          </template>
        </a-dropdown>
      </li>
      <li style="padding: 0"> {{ name }} </li>
    </ul>
  </div>
</template>
@@ -200,6 +201,7 @@
  import Menu from '@/components/menu/index.vue';
  import MessageBox from '../message-box/index.vue';
  import login from '@/assets/images/icon-logo.png';
  import { getUserInfo } from '@/utils/auth';
  const appStore = useAppStore();
  const userStore = useUserStore();
@@ -208,6 +210,7 @@
  const { isFullscreen, toggle: toggleFullScreen } = useFullscreen();
  const locales = [...LOCALE_OPTIONS];
  const avatar = login;
  const name = JSON.parse(getUserInfo()).name || '';
  //const avatar = computed(() => {
  //  return userStore.avatar;
  //});
src/store/modules/user/index.ts
@@ -71,12 +71,14 @@
        const res = await userLogin(loginForm);
        setToken(res.data.access_token);
        const userInfo = {
          avatar: res.data.avatar,
          name: res.data.nickname,
          name: res.data.userName,
          email: res.data.email,
          role: res.data.roles[0].roleKey,
        };
        this.name=res.data.userName
     
        if(res.data?.roles.length>0)
            this.resources=res.data.roles[0].resources;
src/views/dmx/IntelligentAgent/components/agentConfig.vue
@@ -573,6 +573,11 @@
        delete formNew.off;
        title = '修改成功';
      }
      if (!max_tokens.value) {
        formNew.llm_setting.max_tokens = '';
      }
      setLoading(true);
      try {
        const data = await dialogSet(formNew);
@@ -600,11 +605,15 @@
    visible.value = true;
    nextTick(() => {
      // console.log(props.formData,'传入数据');
      if (props.formData.llm_setting.max_tokens == '') {
        max_tokens.value = false;
      } else {
        max_tokens.value = true;
      }
      Object.assign(form, props.formData);
      console.log(form, '表单数据');
    });
  };
  const addVariable = () => {
    form.prompt_config.parameters.push({
@@ -679,9 +688,8 @@
  defineExpose({
    handleClick,
    editClick
    editClick,
  });
</script>
<style lang="less" scoped>
  :deep(.arco-tabs-nav-tab-list) {
src/views/dmx/knowledgeLib/index.vue
@@ -978,12 +978,14 @@
    setLoading(true);
    try {
      const { data } = await queryKbList({ page: 1, page_size: 10 });
      console.log(data, '查询知识库列表');
      tabs.value = data;
      if (tabs.value.length > 0) {
        // 定位到新增的知识库单元
        selectedTab.value = tabs.value.findIndex((item) => item.id == id);
        getKbdetail(id); // 获取详情
        kbobj.id = id;
        activeKey.value = '3';
      }
    } catch (err) {