|
|
@@ -165,7 +165,7 @@ async function loginWithDingTalk() {
|
|
|
|
|
|
axios
|
|
|
.post(
|
|
|
- "https://portal.deepoil.cc/admin-api/system/auth/h5SocialLogin",
|
|
|
+ import.meta.env.BASE_URL + "/admin-api/system/auth/h5SocialLogin",
|
|
|
{
|
|
|
code: code,
|
|
|
type: 20,
|
|
|
@@ -198,17 +198,16 @@ async function loginWithDingTalk() {
|
|
|
}
|
|
|
|
|
|
function dingTalkAutoLogin() {
|
|
|
- // const ua = window.navigator.userAgent.toLowerCase();
|
|
|
+ const ua = window.navigator.userAgent.toLowerCase();
|
|
|
|
|
|
- // console.log("ua :>> ", ua);
|
|
|
+ console.log("ua>>>>>>>>>>>>>>>>>>>>>>> ", ua);
|
|
|
|
|
|
- // if (!ua.includes("dingtalk") && !ua.includes("dingtalkwork")) return;
|
|
|
-
|
|
|
- loginWithDingTalk();
|
|
|
+ if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
|
|
|
+ loginWithDingTalk();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const unreadCount = ref(0); // 未读消息数量
|
|
|
-const list = ref<any[]>([]); // 消息列表
|
|
|
// 获得未读消息数
|
|
|
const getUnreadCount = async () => {
|
|
|
getUnreadNotifyMessageCount().then((data) => {
|
|
|
@@ -222,14 +221,17 @@ onMounted(() => {
|
|
|
// 首次加载小红点
|
|
|
// getUnreadCount();
|
|
|
// 轮询刷新小红点
|
|
|
- setInterval(() => {
|
|
|
- if (userStore.getIsSetUser) {
|
|
|
- console.log("轮询刷新小红点");
|
|
|
- getUnreadCount();
|
|
|
- } else {
|
|
|
- unreadCount.value = 0;
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
+ setInterval(
|
|
|
+ () => {
|
|
|
+ if (userStore.getIsSetUser) {
|
|
|
+ console.log("轮询刷新小红点");
|
|
|
+ getUnreadCount();
|
|
|
+ } else {
|
|
|
+ unreadCount.value = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 1000 * 60 * 1,
|
|
|
+ );
|
|
|
});
|
|
|
</script>
|
|
|
|