Files
tk-mini-program/App.vue
pengxiaolong 6107739077 登录
2025-05-20 00:10:07 +08:00

69 lines
1.2 KiB
Vue

<script lang="ts">
// #ifdef APP-PLUS || H5
import { TUIChatKit } from "./TUIKit";
import TUIlogin from "./components/TUILogin.js";
TUIChatKit.init();
// #endif
let vueVersion = 3;
// Required information
// You can get userSig from TencentCloud chat console for Testing TUIKit.
// Deploy production environment please get it from your server.
// View https://cloud.tencent.com/document/product/269/32688
export default {
data() {
return {
info: {},
userSig: "",
chatInfo: {},
};
},
onLoad(option) {
uni.getStorage({
key: "userinfo",
success: (res) => {
this.info = res.data;
},
});
uni.getStorage({
key: "userSig",
success: (res) => {
this.userSig = res.data;
},
});
uni.getStorage({
key: "chatInfo",
success: (res) => {
this.chatInfo = res.data;
},
});
if (this.userSig) {
TUIlogin(this.chatInfo.appId, this.info.userChatId, this.userSig);
}
},
provide() {
return {
$global: {
lastPage: null,
},
};
},
};
</script>
<style>
/* common css for page */
uni-page-body,
html,
body,
page {
width: 100% !important;
height: 100% !important;
overflow: hidden;
}
</style>