0

1)我不是程序员;我在这里和那里涉猎。

2) 我正在使用 Squarespace 建立一个商业网站 www.prisma-pi.com

3) 我希望特定客户能够使用订阅者登录访问他们的私人页面(通过 SENTRYLOGIN.com 完全完成)

4) 我还希望该私人页面提供聊天服务(通过 CLOUD.COMETCHAT.com 部分完成)

我缺少的是:我希望 SENTRYLOGIN 与 COMETCHAT“交谈”。

以便 SENTRYLOGIN 中的用户信息(例如用户名)加载到 COMETCHAT 上。

COMETCHAT 提供了我“注入”到 Squarespace 中的代码,很明显需要使用来自 SENTRYLOGIN 的输入来更新变量。(这是我在这个问题上的知识差距)。

    var chat_name = 'LOGGEDIN_USERNAME' ;
    var chat_id = 'LOGGEDIN_USERNAME_ID';
    var chat_avatar = 'LOGGEDIN_PROFILE_IMAGE';
    var chat_link = 'LOGGEDIN_USERS_PROFILE_LINK' ;
    </script>
    <link type="text/css" href="//fast.cometondemand.net/11205x002c3.css" rel="stylesheet" charset="utf-8">
    <script type="text/javascript" 
    src="//fast.cometondemand.net/11205x002c3.js" charset="utf-8"></script>

这是 CometChat 网站上提供的一些信息,他们说了一些类似的话:“Cookie 就是你所需要的” https://support.cometchat.com/documentation/php/installing-cometchat/custom-coded-site/java-or -jsp站点/

SENTRYLOGIN 提供对一些看起来很有希望完成该任务的 JS 代码的访问,但我不知道如何完成它。

您可以在登录页面 www.prisma-pi.com/sign-in/ 查看 Sentrylogin 的源代码,一些相关的 JS 代码在这里找到:http ://www.sentrylogin.com/sentry/scripts/SENTRY_AJAX_Style2014.js

任何帮助将不胜感激。如果您需要更多信息,请告诉我。

4

1 回答 1

0

我还没有测试过代码,但看起来 SentryLogin 将登录信息存储在 cookie 中。如果您在 CometChat 代码之前调用了 SentryLogin 代码,那么这样的事情应该可以工作:

if (getCookie('Sentry_loginTkn') != '') { // Check if user is logged in

   var chat_name = getCookie('Sentry_firstName')+' '+getCookie('Sentry_lastName');
    var chat_id = getCookie('Sentry_member_ID');
    var chat_avatar = '';
    var chat_link = '' ;
}
于 2017-08-14T08:06:47.840 回答