diff --git a/AIchat.rar b/AIchat.rar
index 81667e2..e0ace03 100644
Binary files a/AIchat.rar and b/AIchat.rar differ
diff --git a/src/manifest.json b/src/manifest.json
index 30e9fa2..692398c 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -6,6 +6,7 @@
"versionCode": "100",
"transformPx": false,
"app-plus": {
+
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index cb3d29d..3094c6b 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -13,7 +13,7 @@
-
+
小墨
@@ -21,11 +21,12 @@
+
@@ -45,33 +46,36 @@
>
-
+
{{ formatDayGroup(msg.timestamp) }}
-
+
{{ formatTimeShort(msg.timestamp) }}
@@ -148,12 +152,12 @@
@@ -503,11 +507,12 @@ const refreshToken = ref('')
const statusBarHeight = ref(0)
const mask = ref('')
// ---- 页面初始化 ----
+
onMounted(() => {
// 1. 定义一个 init 函数,拿 Extras 并依次调用接口
+
const init = async () => {
const wv = plus.webview.currentWebview()
-
token.value = wv.token || uni.getStorageSync('token') || import.meta.env.VITE_DEV_TOKEN
userInfo.value = JSON.parse(wv.userInfo) || {}
refreshToken.value = wv.refreshToken || uni.getStorageSync('refreshToken')
@@ -517,29 +522,31 @@ onMounted(() => {
await createChatSession()
await fetchHistoryList()
}
+ init()
- // 2. 如果在 Plus 环境里,等 plusready
- if (window.plus && plus.webview) {
- document.addEventListener('plusready', init, false)
- // plusready 可能已经触发过,直接再调用一次以防万一
- if (plus.webview.currentWebview()) {
- init()
- }
- }
- // 3. 普通 H5 调试,直接从 storage/SystemInfo 拿
- else {
- token.value = import.meta.env.VITE_DEV_TOKEN || uni.getStorageSync('token') || wv.token
- userInfo.value = uni.getStorageSync('userInfo')
- refreshToken.value = uni.getStorageSync('refreshToken')
- statusBarHeight.value = uni.getSystemInfoSync().statusBarHeight
-
- createChatSession().then(fetchHistoryList)
- }
+ // // 2. 如果在 Plus 环境里,等 plusready
+ // if (window.plus && plus.webview) {
+ // document.addEventListener('plusready', init, false)
+ // // plusready 可能已经触发过,直接再调用一次以防万一
+ // if (plus.webview.currentWebview()) {
+ // init()
+ // }
+ // }
+ // // 3. 普通 H5 调试,直接从 storage/SystemInfo 拿
+ // else {
+ // token.value = uni.getStorageSync('token') || import.meta.env.VITE_DEV_TOKEN
+ // userInfo.value = uni.getStorageSync('userInfo')
+ // refreshToken.value = uni.getStorageSync('refreshToken')
+ // statusBarHeight.value = uni.getSystemInfoSync().statusBarHeight
+ // createChatSession().then(fetchHistoryList)
+ // }
})
function scrollToBottom() {
const el = scrollEl.value!
nextTick(() => {
+ // el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' })
+ console.log(el.scrollHeight, 'el.scrollHeight')
el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' })
})
}