403 当应用在控制台中的相关服务选项未打开,如 Class 关闭了权限,或是 User 缺失了 session 信息等情况下,云端会统一地返回 403 错误码及不同的错误信息,代表当前请求因权限不够而被拒。例如: 信息 - Forbidden to read/write by class permissions 含义 - 操作被禁止,因为 Class 表没有打开「读」或者「写」的权限。进入 控制台 > 存储,点击相应的 Class,从右侧选择 其他 下拉菜单,进入 权限管理 来调整。 信息 - The user cannot be altered by a client without the session. 含义 - 用户没有登录,无法修改用户信息。
Uncaught TypeError: Cannot redefine property: applicationId at Function.defineProperty (<anonymous>) at init.js?ddd7:165 Uncaught TypeError: Cannot redefine property: applicationId at Function.defineProperty (<anonymous>) at init.js?ddd7:165 at Array.forEach (<anonymous>) at Object.<anonymous> (init.js?ddd7:174) at e (bootstrap bacf8240e97c4b30b3d3?b629:19) at Object.<anonymous> (index.js?9552:19) at e (bootstrap bacf8240e97c4b30b3d3?b629:19) at bootstrap bacf8240e97c4b30b3d3?b629:65 at bootstrap bacf8240e97c4b30b3d3?b629:65 at universalModuleDefinition?5ca6:9
{% if theme.leancloud_visitors.enable and !theme.valine.visitor %} {# custom analytics part create by xiamo; edited by LEAFERx #} <script> {% if page.layout === 'post' %} function addCount(Counter) { var $visitors = $('.leancloud_visitors'); var url = $visitors.attr('id').trim(); var title = $visitors.attr('data-flag-title').trim();
Counter('get', '/classes/Counter', { where: JSON.stringify({ url }) }) .done(function({ results }) { if (results.length > 0) { var counter = results[0]; {% if theme.leancloud_visitors.betterPerformance %} var $element = $(document.getElementById(url)); $element.find('.leancloud-visitors-count').text(counter.time + 1); {% endif %} Counter('put', '/classes/Counter/' + counter.objectId, JSON.stringify({ time: { '__op': 'Increment', 'amount': 1 } })) {% if not theme.leancloud_visitors.betterPerformance %} .done(function() { var $element = $(document.getElementById(url)); $element.find('.leancloud-visitors-count').text(counter.time + 1); }) {% endif %} .fail(function ({ responseJSON }) { console.log('Failed to save Visitor num, with error message: ' + responseJSON.error); }) } else { {% if theme.leancloud_visitors.security %} var $element = $(document.getElementById(url)); $element.find('.leancloud-visitors-count').text('Counter not initialized! More info at console err msg.'); console.error('ATTENTION! LeanCloud counter has security bug, see how to solve it here: https://github.com/theme-next/hexo-leancloud-counter-security. \n However, you can still use LeanCloud without security, by setting `security` option to `false`.'); {% else %} Counter('post', '/classes/Counter', JSON.stringify({ title: title, url: url, time: 1 })) .done(function() { var $element = $(document.getElementById(url)); $element.find('.leancloud-visitors-count').text(1); }) .fail(function() { console.log('Failed to create'); }); {% endif %} } }) .fail(function ({ responseJSON }) { console.log('LeanCloud Counter Error: ' + responseJSON.code + ' ' + responseJSON.error); }); } {% else %} function showTime(Counter) { var entries = []; var $visitors = $('.leancloud_visitors');
if (results.length === 0) { $visitors.find(COUNT_CONTAINER_REF).text(0); return; }
for (var i = 0; i < results.length; i++) { var item = results[i]; var url = item.url; var time = item.time; var element = document.getElementById(url);
$(element).find(COUNT_CONTAINER_REF).text(time); } for (var i = 0; i < entries.length; i++) { var url = entries[i]; var element = document.getElementById(url); var countSpan = $(element).find(COUNT_CONTAINER_REF); if (countSpan.text() == '') { countSpan.text(0); } } }) .fail(function ({ responseJSON }) { console.log('LeanCloud Counter Error: ' + responseJSON.code + ' ' + responseJSON.error); }); } {% endif %}