From efdf1f4ccbaad3ebb0c52c1673dfe3587c30cc60 Mon Sep 17 00:00:00 2001 From: wlh Date: Fri, 26 Dec 2014 17:11:05 +0800 Subject: [PATCH] change server_url --- .gitignore | 30 +++++++++++++++++++++++++++++ tuban/build/main.js | 42 +++++++++++++++++++++-------------------- tuban/build/main.min.js | 2 +- 3 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0534f7b --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +config.sample.json + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- +node_modules + +# Users Environment Variables +.lock-wscript diff --git a/tuban/build/main.js b/tuban/build/main.js index 141b0d5..1e8a615 100644 --- a/tuban/build/main.js +++ b/tuban/build/main.js @@ -50,6 +50,7 @@ })(window);; var app = angular.module('app', ['ui.router', 'ngCookies']); +var SERVER_BASE_URL = 'http://123.57.39.116:6547/'; //初始化配置 app.run(['$rootScope', function($rootScope) { @@ -60,28 +61,29 @@ app.run(['$rootScope', function($rootScope) { }]); + //调用的服务列表 app.constant('ServiceConfig', { - wei_content: 'http://127.0.0.1:3000/wei/get', - wei_zan: 'http://127.0.0.1:3000/wei/zan', - wei_comment: 'http://127.0.0.1:3000/wei/comment', - wei_create: 'http://127.0.0.1:3000/wei/create', - user_get: 'http://127.0.0.1:3000/user/get', - user_login: 'http://127.0.0.1:3000/user/login', - user_register: 'http://127.0.0.1:3000/user/register', - user_common: 'http://127.0.0.1:3000/user/getCommon', - user_ben: 'http://127.0.0.1:3000/user/getBen', - user_self: 'http://127.0.0.1:3000/user/getSelf', - user_common_update: 'http://127.0.0.1:3000/user/updateCommon', - user_ben_update: 'http://127.0.0.1:3000/user/updateBen', - user_ben_get_name: 'http://127.0.0.1:3000/user/singleBen/name', - user_common_get_nickname: 'http://127.0.0.1:3000/user/getCommon/name', - user_ben_get_realname: 'http://127.0.0.1:3000/user/singleBen/name', - wei_get_token_page: 'http://127.0.0.1:3000/wei/getByToken', - wei_delete: 'http://127.0.0.1:3000/wei/delete', - user_update_password: 'http://127.0.0.1:3000/user/updatePassword', - article_get: 'http://127.0.0.1:3000/article/get', - article_detail: 'http://127.0.0.1:3000/article/get/id', + wei_content: SERVER_BASE_URL + 'wei/get', + wei_zan: SERVER_BASE_URL + 'wei/zan', + wei_comment: SERVER_BASE_URL + 'wei/comment', + wei_create: SERVER_BASE_URL + 'wei/create', + user_get: SERVER_BASE_URL + 'user/get', + user_login: SERVER_BASE_URL + 'user/login', + user_register: SERVER_BASE_URL + 'user/register', + user_common: SERVER_BASE_URL + 'user/getCommon', + user_ben: SERVER_BASE_URL + 'user/getBen', + user_self: SERVER_BASE_URL + 'user/getSelf', + user_common_update: SERVER_BASE_URL + 'user/updateCommon', + user_ben_update: SERVER_BASE_URL + 'user/updateBen', + user_ben_get_name: SERVER_BASE_URL + 'user/singleBen/name', + user_common_get_nickname: SERVER_BASE_URL + 'user/getCommon/name', + user_ben_get_realname: SERVER_BASE_URL + 'user/singleBen/name', + wei_get_token_page: SERVER_BASE_URL + 'wei/getByToken', + wei_delete: SERVER_BASE_URL + 'wei/delete', + user_update_password: SERVER_BASE_URL + 'user/updatePassword', + article_get: SERVER_BASE_URL + 'article/get', + article_detail: SERVER_BASE_URL + 'article/get/id', amap_url: 'http://webapi.amap.com/maps?v=1.3&key=ad925c5003760094713775d64748d872&callback=init' }); diff --git a/tuban/build/main.min.js b/tuban/build/main.min.js index 353899a..d40d877 100644 --- a/tuban/build/main.min.js +++ b/tuban/build/main.min.js @@ -1,2 +1,2 @@ /*! tuban-wlhmyit 2014-12-26 */ -!function(a){function b(a,b,c,d,e,f,g,h){if(!document.getElementById("__vczero_vczero_tip")){var i=document.createElement("div");i.style.position="fixed","number"==typeof a&&(i.style.top=a+"px"),"number"==typeof b&&(i.style.left=b+"px"),"number"==typeof c&&(i.style.right=c+"px"),"number"==typeof d&&(i.style.bottom=d+"px"),i.id="__vczero_vczero_tip",i.style.zIndex="100",i.style.height=f+"px",i.style.width=e+"px",i.style.backgroundColor="#000",i.style.opacity="0.7",i.style.color="#FFF",i.style.textAlign="center",i.style.fontSize="15px",i.style.lineHeight=f/h+"px",i.style.borderRadius="3px",i.innerHTML=g,document.getElementsByTagName("body")[0].appendChild(i)}}function c(){var a=document.getElementById("__vczero_vczero_tip");a&&document.querySelector("body").removeChild(a)}var d={setTip:b,hideTip:c};a.Tip=d}(window);var app=angular.module("app",["ui.router","ngCookies"]);app.run(["$rootScope",function(a){a.appName="图班网",a.desc="基于位置的通讯录",a.author="鬼谣",a.email="wlhmyit@126.com"}]),app.constant("ServiceConfig",{wei_content:"http://127.0.0.1:3000/wei/get",wei_zan:"http://127.0.0.1:3000/wei/zan",wei_comment:"http://127.0.0.1:3000/wei/comment",wei_create:"http://127.0.0.1:3000/wei/create",user_get:"http://127.0.0.1:3000/user/get",user_login:"http://127.0.0.1:3000/user/login",user_register:"http://127.0.0.1:3000/user/register",user_common:"http://127.0.0.1:3000/user/getCommon",user_ben:"http://127.0.0.1:3000/user/getBen",user_self:"http://127.0.0.1:3000/user/getSelf",user_common_update:"http://127.0.0.1:3000/user/updateCommon",user_ben_update:"http://127.0.0.1:3000/user/updateBen",user_ben_get_name:"http://127.0.0.1:3000/user/singleBen/name",user_common_get_nickname:"http://127.0.0.1:3000/user/getCommon/name",user_ben_get_realname:"http://127.0.0.1:3000/user/singleBen/name",wei_get_token_page:"http://127.0.0.1:3000/wei/getByToken",wei_delete:"http://127.0.0.1:3000/wei/delete",user_update_password:"http://127.0.0.1:3000/user/updatePassword",article_get:"http://127.0.0.1:3000/article/get",article_detail:"http://127.0.0.1:3000/article/get/id",amap_url:"http://webapi.amap.com/maps?v=1.3&key=ad925c5003760094713775d64748d872&callback=init"}),app.config(["$httpProvider",function(a){a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=utf-8",a.defaults.headers.put["Content-Type"]="application/x-www-form-urlencoded;charset=utf-8",a.defaults.transformRequest=[function(a){var b=[];for(var c in a)b.push(c+"="+a[c]);return b.join("&")}]}]),app.config(["$stateProvider","$urlRouterProvider",function(a,b){b.otherwise("/"),a.state("index",{url:"/",views:{"":{templateUrl:"views/index/index.html"},"header@index":{templateUrl:"views/header.html",controller:"HeaderController"},"footer@index":{templateUrl:"views/footer.html",controller:""},"weibo@index":{templateUrl:"views/index/weibo.html",controller:"WeiboController"},"article@index":{templateUrl:"views/index/article.html",controller:"ArticleController"},"post@index":{templateUrl:"views/index/post.html",controller:"PostWeiboController"}}}).state("login",{url:"/login",views:{"":{templateUrl:"views/login/login.html",controller:"LoginController"}}}).state("register",{url:"/register",views:{"":{templateUrl:"views/register/register.html",controller:"RegisterController"}}}).state("contacts",{url:"/contacts",views:{"":{templateUrl:"views/contacts/contacts.html",controller:""},"header@contacts":{templateUrl:"views/header.html",controller:"HeaderController"},"userinfo@contacts":{templateUrl:"views/contacts/userinfo.html",controller:"UserInfoController"},"map@contacts":{templateUrl:"views/contacts/map.html",controller:"MapController"},"search@contacts":{templateUrl:"views/contacts/search.html",controller:"SearchUserController"}}}).state("ucenter",{url:"/ucenter",views:{"":{templateUrl:"views/ucenter/ucenter.html",controller:""},"header@ucenter":{templateUrl:"views/header.html",controller:"HeaderController"},"userWeibo@ucenter":{templateUrl:"views/ucenter/weibo.html",controller:"UcWeiboController"},"userDetailInfo@ucenter":{templateUrl:"views/ucenter/user.html",controller:"UcUserController"},"footer@ucenter":{templateUrl:"views/footer.html",controller:""}}}).state("article",{url:"/article/:id",views:{"":{templateUrl:"views/article/article.html",controller:""},"header@article":{templateUrl:"views/header.html",controller:"HeaderController"},"article_content@article":{templateUrl:"views/article/article_content.html",controller:"ArticleDetailController"},"footer@article":{templateUrl:"views/footer.html",controller:""}}}).state("article_index",{url:"/article",views:{"":{templateUrl:"views/article/article.html",controller:""},"header@article_index":{templateUrl:"views/header.html",controller:"HeaderController"},"article_content@article_index":{templateUrl:"views/article/article_content.html",controller:"ArticleDetailController"},"footer@article_index":{templateUrl:"views/footer.html",controller:""}}})}]),app.service("SelfWeibo",["$http","ServiceConfig","Time",function(a,b,c){return{getData:function(d,e,f){var g="?token="+d+"&page="+e;a.get(b.wei_get_token_page+g).success(function(a){if(a.status){var b=a.items;for(i in b){b[i].time=c.formatTime(b[i].time);for(var d in b[i].comments)b[i].comments[d].time=c.formatTime(b[i].comments[d].time)}}f(a)}).error(function(){f({status:0})})}}}]),app.service("Time",function(){return{formatTime:function(a){var b=new Date(a);return b.getFullYear()+"-"+(parseInt(b.getMonth())+1)+"-"+b.getDate()+" "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()}}}),app.service("WeiboData",["$http","Time","ServiceConfig",function(a,b,c){return{getItems:function(d,e){a.get(c.wei_content+"?page="+d).success(function(a){var c=[];if(a.status){c=a.items;for(var d=0;d10&&(b.items=b.items.slice(0,10))}),b.zan=function(b){var e=c.get("user");if(e){var f="token="+e.token,g="&id="+b._id,h="http://127.0.0.1:3000/wei/zan?"+f+g;a.get(h).success(function(a){a.status?a.zans?(b.zans=a.zans,Tip.setTip(200,350,null,null,240,80,"谢谢您的打赏~~~~",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"伦家怎么好意思再收呢!",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"不好意思,打赏失败了...",1),d(Tip.hideTip,2300))}).error(function(){Tip.setTip(200,350,null,null,260,80,"服务君感冒了,请刷新页面重试...",1),d(Tip.hideTip,2300)})}else Tip.setTip(200,350,null,null,240,80,"只有登录了,才能点赞哦~~~",1),d(Tip.hideTip,2300)},b.comment=function(a){a.isShowComDiv=a.isShowComDiv?!1:!0},b.addComment=function(b,e){var g=c.get("user");if(g&&e){var h="token="+g.token,i="&comment="+e,j="&id="+b._id,k="http://127.0.0.1:3000/wei/comment?"+h+i+j;a.get(k).success(function(a){a.status?(b.comments.push({nickname:a.nickname,email:a.email,comment:a.comment,avatar:a.avatar,time:f.formatTime(a.time)}),document.getElementById("_commentContent").value="",Tip.setTip(200,350,null,null,240,80,"您的评论实在是精彩了~~",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"不好意思,评论失败了...",1),d(Tip.hideTip,2300))}).error(function(){Tip.setTip(200,350,null,null,240,80,"服务君感冒了,评论失败了...",1),d(Tip.hideTip,2300)})}else Tip.setTip(200,350,null,null,280,80,"请登录,评论的内容不能为空~~",1),d(Tip.hideTip,2300)},b.prePage=function(){b.currentPage=b.currentPage-1,b.currentPage>=0?g.getItems(10*b.currentPage,function(a){a.length?b.items=a:(Tip.setTip(200,350,null,null,260,80,"君别着急,现在都查不出数据了...",1),d(Tip.hideTip,2300))}):(b.currentPage=b.currentPage+1,Tip.setTip(200,350,null,null,260,80,"君别翻旧账了,这是第一页啦~~~",1),d(Tip.hideTip,2300))},b.nextPage=function(){b.currentPage=b.currentPage+1,b.currentPage=0?g.getData(h.token,j,function(b){b.status&&(a.items=b.items)}):(j=0,Tip.setTip(250,(parseInt(i)-240)/2,null,null,260,80,"已经是第一页...",1),d(Tip.hideTip,3e3))},a.nextPage=function(){j+=1,j10&&(b.items=b.items.slice(0,10))}),b.zan=function(b){var e=c.get("user");if(e){var f="token="+e.token,g="&id="+b._id,h="http://127.0.0.1:3000/wei/zan?"+f+g;a.get(h).success(function(a){a.status?a.zans?(b.zans=a.zans,Tip.setTip(200,350,null,null,240,80,"谢谢您的打赏~~~~",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"伦家怎么好意思再收呢!",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"不好意思,打赏失败了...",1),d(Tip.hideTip,2300))}).error(function(){Tip.setTip(200,350,null,null,260,80,"服务君感冒了,请刷新页面重试...",1),d(Tip.hideTip,2300)})}else Tip.setTip(200,350,null,null,240,80,"只有登录了,才能点赞哦~~~",1),d(Tip.hideTip,2300)},b.comment=function(a){a.isShowComDiv=a.isShowComDiv?!1:!0},b.addComment=function(b,e){var g=c.get("user");if(g&&e){var h="token="+g.token,i="&comment="+e,j="&id="+b._id,k="http://127.0.0.1:3000/wei/comment?"+h+i+j;a.get(k).success(function(a){a.status?(b.comments.push({nickname:a.nickname,email:a.email,comment:a.comment,avatar:a.avatar,time:f.formatTime(a.time)}),document.getElementById("_commentContent").value="",Tip.setTip(200,350,null,null,240,80,"您的评论实在是精彩了~~",1),d(Tip.hideTip,2300)):(Tip.setTip(200,350,null,null,240,80,"不好意思,评论失败了...",1),d(Tip.hideTip,2300))}).error(function(){Tip.setTip(200,350,null,null,240,80,"服务君感冒了,评论失败了...",1),d(Tip.hideTip,2300)})}else Tip.setTip(200,350,null,null,280,80,"请登录,评论的内容不能为空~~",1),d(Tip.hideTip,2300)},b.prePage=function(){b.currentPage=b.currentPage-1,b.currentPage>=0?g.getItems(10*b.currentPage,function(a){a.length?b.items=a:(Tip.setTip(200,350,null,null,260,80,"君别着急,现在都查不出数据了...",1),d(Tip.hideTip,2300))}):(b.currentPage=b.currentPage+1,Tip.setTip(200,350,null,null,260,80,"君别翻旧账了,这是第一页啦~~~",1),d(Tip.hideTip,2300))},b.nextPage=function(){b.currentPage=b.currentPage+1,b.currentPage=0?g.getData(h.token,j,function(b){b.status&&(a.items=b.items)}):(j=0,Tip.setTip(250,(parseInt(i)-240)/2,null,null,260,80,"已经是第一页...",1),d(Tip.hideTip,3e3))},a.nextPage=function(){j+=1,j