Skip to content

Commit

Permalink
添加服务api接口框架
Browse files Browse the repository at this point in the history
  • Loading branch information
yujinjin committed Mar 20, 2017
1 parent d12b0b5 commit 59e4c8f
Show file tree
Hide file tree
Showing 12 changed files with 706 additions and 10 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<title>粉丝煲</title>
<link rel="shortcut icon" href="./build/goldfish.ico"><link href="./build/style.265fc778e6821314bf74.css" rel="stylesheet"></head>
<link rel="shortcut icon" href="./build/goldfish.ico"><link href="./build/style.css" rel="stylesheet"></head>

<body>
<div class="views">
<div id="app"></div>
</div>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js" charset="utf-8"></script>
<script type="text/javascript" src="./build/common.265fc778e6821314bf74.js"></script><script type="text/javascript" src="./build/build.265fc778e6821314bf74.js"></script></body>
<script type="text/javascript" src="./build/common.js"></script><script type="text/javascript" src="./build/build.js"></script></body>

</html>
7 changes: 6 additions & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ const site = {
if(!_options.data) {
_options.data = {};
}
if(_url.lastIndexOf(".json") > -1){
_options.type = "GET";
_options.headers = {"Content-Type": "application/x-www-form-urlencoded"};
}
if(_options.type.toUpperCase() === 'GET'){
_url += '&rnd='+ (+new Date()+'');
_options.data = _options.data || {};
} else if(!_url.match(/^(?:http|ftp|https):\/\//)){
}
if(!_url.match(/^(?:http|ftp|https):\/\//) && _url.lastIndexOf(".json") == -1){
//如果传的url含有 http://说明是个绝对路径,就不用拼了
_url = app.Config.webapiDomain + _url;
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/signalR.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
//$.connection.hub.url = app.Config.webapiDomain + "/signalr/hubs";
Promise.all([
require("../lib/jquery.signalR-2.2.1"),
require("http://storeapi.dev.zmscrm.cn/signalr/hubs")
require("http://storeapi.dev.sqj.fanscrm.cn/signalr/hubs")
]).then(function() {
_this.retgisterQrScan();
_this.connect();
Expand Down
Loading

0 comments on commit 59e4c8f

Please sign in to comment.