Closed rainx closed 7 years ago
请将其中的 dzhyun.ini 里的 server 地址改为 gw.yundzh.com
貌似依然是有问题
Starting /Users/rainx/dev/build-QDzh3-Desktop_Qt_5_7_1_clang_64bit-Release/QDZH3.app/Contents/MacOS/QDZH3... ConfigureSetting::setSettingUserInfo user: "" ConfigureSetting::getFileFullPathBySystem(): "/Users/rainx/dev/build-QDzh3-Desktop_Qt_5_7_1_clang_64bit-Release/QDZH3.app/Contents/MacOS/../Resources/" ConfigureSetting::filepath "/Users/rainx/dev/build-QDzh3-Desktop_Qt_5_7_1_clang_64bit-Release/QDZH3.app/Contents/MacOS/../Resources/dzhyun.ini" ConfigureSetting::setSettingUserInfo first new QSettings(). ConfigureSetting::getDzhYunType() 1 DzhYun/yuntype: 1 QString::arg: Argument missing: 无法解析res_init中的符号“__res_init”:resolv, (dlsym(0x115bd1d10, res_init): symbol not found) QString::arg: Argument missing: 无法解析res_ninit中的符号“__res_ninit”:resolv, (dlsym(0x115bd1d10, res_ninit): symbol not found) QString::arg: Argument missing: 无法解析res_ninit中的符号“res_ninit”:resolv, (dlsym(0x115bd1d10, res_ninit): symbol not found) ConfigureSetting::getHost() "gw.yundzh.com" qml: 登陆中.. DataChannel onStartDataChannel CloseDataChannel end. ConfigureSetting::getIsOutputLogToFile() 0 ConfigureSetting::getLogOutputLevel() 0 程序异常结束。 /Users/rainx/dev/build-QDzh3-Desktop_Qt_5_7_1_clang_64bit-Release/QDZH3.app/Contents/MacOS/QDZH3 crashed.
generatetoken.cpp 里是否设置了正确的 appid 和 appkey
@elsejj 应该设置的是正确的, 刚才看了一下代码, 在登陆这里
var url = 'https://i.gw.com.cn/UserCenter/page/account/login'; //此处为模拟的地址,需要改成指定的登录接口 TODO 账号
Util.ajaxGet(url, function(data) {
console.log(data)
我输出了一下登陆之后的结果,好想不是合适的结果,是不是登陆地址有问题:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" Content="no-cach" />
<meta http-equiv="keywords" content="大智慧" />
<meta name="robots" content="all" />
<meta name="author" content="http://www.gw.com.cn" />
<meta name="copyright" content="mo.gw.com.cn 版权所有,未经授权禁止链接、复制或建立镜像。" />
<meta name="description" content="欢迎访问大智慧平台,我们将为您提供最新最及时的财经新闻资讯和最专业的证券行情分析产品!"/>
<meta property="qc:admins" content="25402277177637563675352356452" />
<link rel="shortcut icon" href="/UserCenter/web/images/favicon.ico" type="image/x-icon" />
<title>个人中心-登录</title>
<link type="text/css" media="all" rel="stylesheet" href="/UserCenter/web/css/base.css" />
<link type="text/css" media="all" rel="stylesheet" href="/UserCenter/web/css/usercenter.css" />
</head>
<body class="container">
<div id="header">
<div class="hd-w">
<h1 class="fl"><a id="headerImg" href="javascript:;" title="大智慧-个人中心"><img src="/UserCenter/web/images/logo_s.jpg" alt="大智慧-个人中心" width="110" height="94"/></a></h1>
<ul class="hd-nav clearfix" id="nav">
</ul>
</div>
</div>
<div id="main">
<div class="user-center bdr8">
<div class="uc-hd">登录</div>
<div class="uc-bd">
<div class="login-status">
<img alt="" src="/UserCenter/web/images/icon-warning.gif" class="login-status-img"><span id="errorMessage" class="login-status-text" ></span>
</div>
<div class="uc-form">
<form id="from" method="POST">
<div class="uc-form-item"><label for="" class="fl">账号</label><input id="uname" name="account" type="text" placeholder="邮箱/手机/用户名" class="uc-ipt" maxlength="50"/></div>
<div class="uc-divider"></div>
<div class="uc-form-item uc-form-item-s"><label for="" class="fl">密码</label>
<input id="newPass" name="upass" type="password" placeholder="请输入密码" class="uc-ipt" maxlength="20"/>
<!-- <i id="switchPass" class="ico-eye fr" show="false"></i> -->
</div>
<div class="uc-divider"></div>
<input value="" id="source" name="source" type="hidden"/>
<div class="uc-form-item uc-form-item-yzm-s"><label for="" class="fl">验证码</label><input id="code" type="text" name="code" placeholder="请输入验证码" class="uc-ipt" maxlength="20"/><span class="yzm-pic fr"><img width="70" height="30" id="ImageVcode"/></span></div>
</form>
</div>
<!--
<p class="uc-form-tips uc-form-tips-pd0 uc-form-tips-alert" id="errorMessage"></p>
-->
<div class="uc-btn"><a id="submitBtn" class="bdr8">登录</a></div>
<div class="uc-link-other">
<span class="fl"><a href="/UserCenter/page/account/register?q=r">注册新用户</a></span>
<span class="fr"><a href="/UserCenter/page/account/forgetPass?q=f">忘记密码</a></span>
</div>
</div>
<div class="uc-ft uc-ft-log">
<div class="uc-log-other">
<p>或使用合作账号登录</p>
<div id="qqLogin" class="log-other-block log-qq" style="width:110px; padding: 30px 36px;"><a href="javascript:;" style="width:110px;height: 68px;" title="使用qq账号登录"></a></div>
<div id="weChatLogin" class="log-other-block log-wx" style="width:110px; padding: 30px 36px;"><a href="javascript:;" style="width:110px;height: 68px;" title="使用微信账号登录"></a></div>
</div>
</div>
</div>
</div>
<div id="tipsPopup" class="wx-popup" style="display:none">
<div class="popup-bg">
</div>
<div class="popup-cont popup-cont-white" style="left: 0%;margin: 10px auto;width:90%;height:90%; top:0%; position: relative;">
<div class="qqbox-close" id="closePopup"></div>
<iframe id="qqIframe" width="100%" height="100%"></iframe>
</div>
</div>
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<div id="footer">
<div class="ft-w">
<p class="ft-links"><a href="http://www.gw.com.cn">大智慧官网</a><a href="http://pay.gw.com.cn/" class="bdl">产品中心</a></p>
<p class="ft-info">Copyright ©2017 www.gw.com.cn 大智慧股份有限公司 版权所有</p>
<p class="ft-info">技术服务热线:021-20219997
</p>
</div>
</div>
</body>
</html>
<div id="weixin_layer" class="weixin-layer" style="display:none">
<div class="weixin-text"><img src="/UserCenter/images/loading.gif" alt="正在努力加载中。。。" style="width:100px; height:100px"/></div>
</div>
<input id="model" value="login" type="hidden"/>
<input id="basePath" value="/UserCenter/" type="hidden"/>
<script type="text/javascript" src="/UserCenter/js/jquery.min.js"></script>
<script type="text/javascript" src="/UserCenter/web/js/json2.js"></script>
<script type="text/javascript" src="/UserCenter/web/js/jquery.placeholder.js"></script>
<script type="text/javascript" src="/UserCenter/config/config.js?v=1.0.26"></script>
<script type="text/javascript" src="/UserCenter/js/gwlogtracker.js?v=1.0.26"></script>
<script type="text/javascript" src="/UserCenter/web/js/pcaccount.js?v=1.0.26"></script>
<script type="text/javascript">
$(function($){
$("#switchPass").click(function(){
function args(elem) {
// Return an object of element attributes
var newAttrs = {};
var rinlinejQuery = /^jQuery\d+$/;
$.each(elem.attributes, function(i, attr) {
if (attr.specified && !rinlinejQuery.test(attr.name)) {
newAttrs[attr.name] = attr.value;
}
});
return newAttrs;
}
var isOperaMini = Object.prototype.toString.call(window.operamini) == '[object OperaMini]';
var isInputSupported = 'placeholder' in document.createElement('input') && !isOperaMini;
if ($('#switchPass').attr('show') == 'false'){
$("#switchPass").attr("class","ico-eye-show fr");
if (!isInputSupported) {
$replacement = $('<input>').attr($.extend(args($('#newPass')[0]), { 'type': 'text', 'id':'', 'name':''})).val($('#newPass').val());
$replacement.on('blur', function(){
$('#newPass').val($replacement.val());
});
$('#newPass').hide().after($replacement);
var value = $('#newPass').val();
if ($.trim(value) == '') {
$replacement.val('请输入密码');
}
if ($replacement.val() == '请输入密码') {
$replacement.addClass('placeholder');
} else {
$replacement.removeClass('placeholder');
}
$replacement.on('focus', function(){
if ($replacement.val() == '请输入密码') {
$replacement.val('');
}
});
} else {
$('#newPass').attr('type', 'text');
}
$('#switchPass').attr('show', 'true');
return ;
}else{
$("#switchPass").attr('class',"ico-eye fr");
if (!isInputSupported) {
var $nextInput = $('#newPass').show().next();
$('#newPass').show().val($nextInput.val());
$nextInput.remove();
} else {
$('#newPass').attr('type', 'password');
}
$('#switchPass').attr('show', 'false');
}
});
//按钮样式
$(".ui-ipt").each(function(){
$(this).on({
keyup:function(){
if($(".ui-ipt").eq(0).val()!==""&&$(".ui-ipt").eq(1).val()!=""&&$(".ui-ipt").eq(2).val()!=""){
$(".ui-button-sub a").removeClass("disabled");
btn_active();
}else{
$(".ui-button-sub a").addClass("disabled");
btn_disbaled();
}
},
blur:function(){
if($(".ui-ipt").eq(0).val()!==""&&$(".ui-ipt").eq(1).val()!=""&&$(".ui-ipt").eq(2).val()!=""){
$(".ui-button-sub a").removeClass("disabled");
btn_active();
}else{
$(".ui-button-sub a").addClass("disabled");
btn_disbaled();
}
}
})
})
function btn_active(){
$(document).on({
touchstart:function(){
$(this).addClass("clicked");
},
touchend:function(){
$(this).removeClass("clicked");
}
},".ui-button-sub a,.ui-button-del a")
}
function btn_disbaled(){
$(document).on({
touchstart:function(){
$(this).removeClass("clicked");
}
},".ui-button-sub a,.ui-button-del a")
}
});
</script>
</body>
</html>
DzhYun/yuntype: 1 (mtype)
如果是这个的话,根据
int mType = ConfigureSetting::getInstance()->getDzhYunType();
qInfo()<< "DzhYun/yuntype:"<< mType;
//模拟数据 TODO appid secretkey 请从大智慧金融信息云http://yun.gw.com.cn/index.html申请
if(mType == 1){
//alpha环境
this->appid = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
this->secret_key = "xxxxxxxxxxxx";
this->short_id = "0000000x";
应该是设置这里
@rainx
var url = 'https://i.gw.com.cn/UserCenter/page/account/login'; //此处为模拟的地址,需要改成指定的登录接口 TODO 账号
这个地址只是开源版本的模拟地址,为了保留登陆流程,方便接入第三方的登录,无实质作用。开源版本目前通过任意用户名和密码均可登录成功。
Crash的原因是你所使用的Qt版本的问题,改到5.7.0,应该就不会出现这个问题。目前发现5.7.1 以及5.8.0 Beta版本的QML Engine的改动(升级),导致部分JS代码会引起Crash。相关的Bug已经提交给Qt QML Engine团队。
@dongsir 试了一下QT5.7.0, 应该可以了
@rainx 好的。高版本的Qt,我们也会尝试适配的。
配置好了appid和key 使用代码库中deployment中提供的dzhyun.ini 作为配置文件 成功编译并运行
在输入账号密码之后(我其实也不太确定密码输的是不是正确)
之后就crash了, 输出为:
Starting /Users/rainx/dev/build-QDzh3-Desktop_Qt_5_7_1_clang_64bit-Release/QDZH3.app/Contents/MacOS/QDZH3... ConfigureSetting::setSettingUserInfo user: "" ConfigureSetting::getFileFullPathBySystem(): "/Users/rainx/dev/build-QDzh3-Desktop_Qt_5_7_1_clang_64bit-Release/QDZH3.app/Contents/MacOS/../Resources/" ConfigureSetting::filepath "/Users/rainx/dev/build-QDzh3-Desktop_Qt_5_7_1_clang_64bit-Release/QDZH3.app/Contents/MacOS/../Resources/dzhyun.ini" ConfigureSetting::setSettingUserInfo first new QSettings(). ConfigureSetting::getDzhYunType() 1 DzhYun/yuntype: 1 QString::arg: Argument missing: 无法解析res_init中的符号“__res_init”:resolv, (dlsym(0x11553bd10, res_init): symbol not found) QString::arg: Argument missing: 无法解析res_ninit中的符号“__res_ninit”:resolv, (dlsym(0x11553bd10, res_ninit): symbol not found) QString::arg: Argument missing: 无法解析res_ninit中的符号“res_ninit”:resolv, (dlsym(0x11553bd10, res_ninit): symbol not found) ConfigureSetting::getHost() "10.15.208.66" DataChannel onStartDataChannel CloseDataChannel end. ConfigureSetting::getIsOutputLogToFile() 0 ConfigureSetting::getLogOutputLevel() 0 [0116/160907:ERROR:mach_broker_mac.mm(52)] bootstrap_look_up: Unknown service name (1102) 程序异常结束。 /Users/rainx/dev/build-QDzh3-Desktop_Qt_5_7_1_clang_64bit-Release/QDZH3.app/Contents/MacOS/QDZH3 crashed.