123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- (function (app) {
- app.factory('userService', ['$http', 'config', "util", 'storage', function ($http, config, util, storage) {
- return {
- wechat_login:function(wechat){
- return $http({
- url: config.server + 'api/auth/wechat_login?wechat=' + wechat+'&jpush=' + localStorage['jpush'],
- method: "get",
- })
- },
- login: function (phone, verify_code,wechat) {
- return $http({
- url: config.server + 'api/auth/login',
- method: "post",
- data: { phone: phone, verify_code: verify_code, wechat:wechat}
- })
- },
- getVerifyCode: function (mobile) {
- return $http({
- url: config.server + 'api/auth/code',
- method: "post",
- data: { phone: mobile}
- })
- },
- isTest: function () {
- return $http({
- url: config.server + 'api/test',
- method: "get",
- })
- },
- jpush:function (data) {
- return $http({
- url: config.server + 'api/user/jpush',
- method: "post",
- data: data
- })
- },
- isLogin: function () {
- return !util.empty(storage.get("token")) && storage.getObject("user");
- },
- info: function(){
- return $http({
- url: config.server + 'api/info',
- method: "get"
- })
- }
- };
- }]);
- })(angular.module('app.services'));
|