myservice.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. (function (app) {
  2. app.factory('myService', ['$http', 'config', "util", function ($http, config, util) {
  3. return {
  4. logout:function(){
  5. return $http({
  6. url:config.server + "api/auth/logout",
  7. method:"get"
  8. })
  9. },
  10. setPassword: function (password) {
  11. return $http({
  12. url: config.server + '/api/auth/password',
  13. method: "post",
  14. data: { password: password }
  15. })
  16. },
  17. recharge:function(money){
  18. return $http({
  19. url:config.server + "api/my/recharge?coin="+money,
  20. method:"post"
  21. })
  22. },
  23. setting:function(){
  24. return $http({
  25. url:config.server + "api/my/setting",
  26. method:"get"
  27. })
  28. },
  29. systemInfo:function(){
  30. return $http({
  31. url:config.server + "api/my/system_info",
  32. method:"get"
  33. })
  34. },
  35. replyMy:function(){
  36. return $http({
  37. url:config.server + "api/my/reply",
  38. method:"get"
  39. })
  40. },
  41. collect:function(){
  42. return $http({
  43. url:config.server + "api/my/collection",
  44. method:"get"
  45. })
  46. },
  47. myDream:function(){
  48. return $http({
  49. url:config.server + "api/my/dream",
  50. method:"get"
  51. })
  52. },
  53. myReplay:function(data){
  54. return $http({
  55. url: config.server + '/api/my/my_reply',
  56. method: "post",
  57. data: data
  58. })
  59. },
  60. myMes:function(){
  61. return $http({
  62. url:config.server + "api/my/persona",
  63. method:"get"
  64. })
  65. },
  66. myInfo:function(){
  67. return $http({
  68. url:config.server + "api/my/show",
  69. method:"get"
  70. })
  71. },
  72. toprofile:function(){
  73. return $http({
  74. url:config.server + "api/my/persona",
  75. method:"get"
  76. })
  77. },
  78. myMaterial:function(){
  79. return $http({
  80. url:config.server + "api/my/update",
  81. method:"get"
  82. })
  83. },
  84. saveMaterial:function(data){
  85. return $http({
  86. url:config.server + "api/my/update",
  87. method:"post",
  88. data:data
  89. })
  90. },
  91. attention:function(){
  92. return $http({
  93. url:config.server + "api/my/care",
  94. method:"get"
  95. })
  96. },
  97. toMyUserDetail:function(id){
  98. return $http({
  99. url:config.server + "api/user/show?user_id=" + id ,
  100. method:"get"
  101. })
  102. },
  103. addAccount:function(data){
  104. return $http({
  105. url:config.server + "api/my/bank/create",
  106. method:"post",
  107. data:data
  108. })
  109. },
  110. showAccount:function(){
  111. return $http({
  112. url:config.server + "api/my/bank/list",
  113. method:"get"
  114. })
  115. },
  116. destroyAccount:function(id){
  117. return $http({
  118. url:config.server + "api/my/bank/delete?id=" + id ,
  119. method:"get"
  120. })
  121. },
  122. withdraw:function(data){
  123. return $http({
  124. url:config.server + "api/my/cash",
  125. method:"post",
  126. data:data
  127. })
  128. },
  129. contact:function(data){
  130. return $http({
  131. url:config.server + "api/my/suggest",
  132. method:"post",
  133. data:data
  134. })
  135. },
  136. payExplain:function(){
  137. return $http({
  138. url:config.server + "api/my/pay/article",
  139. method:"get"
  140. })
  141. },
  142. addQrcode:function(data){
  143. return $http({
  144. url:config.server + "api/my/bank/qrcode",
  145. method:"post",
  146. data:data
  147. })
  148. },
  149. aboutMiao:function(){
  150. return $http({
  151. url:config.server + "api/my/miao",
  152. method:"get"
  153. })
  154. },
  155. messageInfo:function(){
  156. return $http({
  157. url:config.server + "api/my/info",
  158. method:"get"
  159. })
  160. },
  161. notRead:function(){
  162. return $http({
  163. url:config.server + "api/my/read",
  164. method:"get"
  165. })
  166. },
  167. letter:function(){
  168. return $http({
  169. url:config.server + "api/my/letter",
  170. method:"get"
  171. })
  172. }
  173. };
  174. }]);
  175. })(angular.module('app.services'));