From 929b72aadd5df92368e359523779998fe61382a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=89=BF=E6=B7=9E?= <644344980@qq.com> Date: Tue, 1 Aug 2017 15:57:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83=E5=88=A4=E6=96=AD=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/js/main.js | 48 ++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/WebContent/js/main.js b/WebContent/js/main.js index 16db487..6bef35e 100644 --- a/WebContent/js/main.js +++ b/WebContent/js/main.js @@ -7,22 +7,36 @@ }; */ -/*var Conf = { - 'host':'http://www.oschina.com', - 'auth_uri':'/action/oauth2/authorize', - 'response_type':'code', - 'client_id':'yKqX3IQWBvft0W8JXz0k', - 'redirect_uri':'http://www.moveblog.com:8080/Oauth2Action' - }; +var devMode=false; +/*Online Config + * var Conf = { + 'host' : 'http://www.oschina.net', + 'auth_uri' : '/action/oauth2/authorize', + 'response_type' : 'code', + 'client_id' : 'c39L0n9Am23s5wTW10dC', + 'redirect_uri' : 'http://move.oschina.net/Oauth2Action' +}; */ -var Conf = { - 'host' : 'http://www.oschina.com:8090', - 'auth_uri' : '/action/oauth2/authorize', - 'response_type' : 'code', - 'client_id' : '2rbeJBgeNRvg0gqZJIci', - 'redirect_uri' : 'http://www.moveblog.com:8081/Oauth2Action' -}; +if(devMode){ + var Conf = { + 'host' : 'http://www.oschina.com:8090', + 'auth_uri' : '/action/oauth2/authorize', + 'response_type' : 'code', + 'client_id' : '2rbeJBgeNRvg0gqZJIci', + 'redirect_uri' : 'http://www.moveblog.com:8081/Oauth2Action' + }; + var moveDoMain="http://www.oschina.com:8090"; +}else{ + var Conf = { + 'host' : 'http://www.oschina.net', + 'auth_uri' : '/action/oauth2/authorize', + 'response_type' : 'code', + 'client_id' : 'c39L0n9Am23s5wTW10dC', + 'redirect_uri' : 'http://move.oschina.net/Oauth2Action' + }; + var moveDoMain="http://move.oschina.net"; +} var Api = (function(conf, $) { @@ -145,7 +159,7 @@ var Api = (function(conf, $) { }; var getBlogType = function() { - $.getJSON('http://www.moveblog.com:8081/action/syscatalog', function( + $.getJSON(moveDoMain+'/action/syscatalog', function( data) { var options = ""; $.each(data.blog_sys_catalog_list, function(optionindex, option) { @@ -318,7 +332,7 @@ $(function() { $choose_all.show().removeAttr('disabled'); if (list != null) { $blog_list.html(Api.blog_list_tpl(list)); - $.getJSON('http://www.moveblog.com:8081/action/syscatalog', + $.getJSON(moveDoMain+'/action/syscatalog', function(data) { var options = ""; var user_options = ""; @@ -450,7 +464,7 @@ $(function() { $choose_all.show().removeAttr('disabled'); if (list != null) { $blog_list.html(Api.blog_list_tpl(list)); - $.getJSON('http://www.moveblog.com:8080/action/syscatalog', + $.getJSON(moveDoMain+'/action/syscatalog', function(data) { var options = ""; var user_options = ""; -- Gitee