Forráskód Böngészése

🎨 发贴图功能优化

快乐的梦鱼 2 hete
szülő
commit
16e411ab9a

+ 2 - 0
src/common/components/OfficialAccountPublishWrap.vue

@@ -8,6 +8,7 @@
     :show-related="showRelated"
     @publishsuccess="emit('publishsuccess', $event)"
     @publishfail="emit('publishfail', $event)"
+    @empty="emit('empty', $event)"
   >
   </official-account-publish>
 </template>
@@ -33,6 +34,7 @@ const show = ref(true);
 const emit = defineEmits<{
   (e: 'publishsuccess', data: any): void;
   (e: 'publishfail', data: any): void;
+  (e: 'empty', data: any): void;
 }>();
 
 async function recreateComponent() {

+ 5 - 2
src/pages/home/chat/dependent/post/components/agent.vue

@@ -416,7 +416,7 @@ const chatManager = useChat({
       },
       customSystemPrompt: '',
     }),
-    defaultSystemPrompt: `你是一个“乡村文化挖掘笔记/文章写作与改稿助手”,工作在一个笔记编辑器里。你需要在与用户对话的同时,能直接读取并修改当前文章(标题与正文)。
+    defaultSystemPrompt: `你是一个亮乡源的“乡村文化挖掘笔记/文章写作与改稿助手”,工作在一个笔记编辑器里。你需要在与用户对话的同时,能直接读取并修改当前文章(标题与正文)。
 
 ## 工作目标
 - 帮用户写作:构思、列提纲、扩写、续写、改写、润色、降重、统一文风、改错别字与语病。
@@ -434,7 +434,10 @@ const chatManager = useChat({
     onGetAppendSystemMessages: () => {
       const result = [] as string[];
       result.push('## 编写内容');
-      result.push('用户正在编写话题:' + props.tag?.replace('广场', ''));
+      result.push('用户正在编写话题:' + 
+        //亮乡源话题中的“广场”意思是话题广场,AI容易曲解为现实中的地标广场,此处需要去除
+        props.tag?.replace('广场', '')
+      );
       if (props.villageInfo) {
         result.push('用户编写内容与此村社有关:' + props.villageInfo.name);
         result.push('地址:' + props.villageInfo.address);

+ 14 - 2
src/pages/home/chat/dependent/post/publish.vue

@@ -73,7 +73,7 @@
 import { onMounted, ref, watch } from 'vue';
 import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
 import { Debounce } from '@imengyu/imengyu-utils';
-import { confirm, toast } from '@/components/dialog/CommonRoot';
+import { confirm, toast, alert } from '@/components/dialog/CommonRoot';
 import { useAuthStore } from '@/store/auth';
 import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
 import { envVersion } from '@/common/config/AppCofig';
@@ -92,11 +92,23 @@ import PrimaryButton from '@/common/components/PrimaryButton.vue';
 import Tbutton from './components/tbutton.vue';
 import Height from '@/components/layout/space/Height.vue';
 import type { UploaderAction, UploaderItem } from '@/components/form/Uploader';
+import { back, backAndCallOnPageBack } from '@/components/utils/PageAction';
 
 const { querys } = useLoadQuerys({
   tag: '',
   villageId: 0,
 }, () => {
+
+  if (!(uni as any).shareToOfficialAccount) {
+    alert({
+      title: '提示',
+      content: '抱歉,微信目前不支持在电脑端编写贴图,您可以在手机版微信中编写贴图哦!',
+    }).then(() => {
+      back();
+    })
+    return;
+  }
+
   villageInfoForAI.load();
 });
 const authStore = useAuthStore();
@@ -215,7 +227,7 @@ function publish() {
       uni.removeStorageSync('postDraft');
       toast('发布成功');
       setTimeout(() => {
-        uni.navigateBack();
+        backAndCallOnPageBack('refreshOfficialAccount', { })
       }, 1000);
     },
     fail: (error: any) => {