Mike 7 лет назад
Родитель
Сommit
836e45ae30

+ 3 - 3
miaomiao/www/js/controllers/account.js

xqd xqd
@@ -9,8 +9,8 @@
                     // response.code;
                     if(response.code){
                         msg.loading('登录中...');
-                        userService.loginbywx(response.code).then(function(result){
-                            alert("loginbywx success: " + JSON.stringify(result));
+                        userService.wechat_login(response.code).then(function(result){
+                            alert("wechat_login success: " + JSON.stringify(result));
                             msg.hide();
                             storage.setObject('user', result.data.data.user);
                             storage.set('token', result.data.data.token);
@@ -18,7 +18,7 @@
                             $scope.user=storage.getObject('user');
                             $state.go('app.home');
                         },function(error){
-                            // alert("loginbywx Failed: " + JSON.stringify(error));
+                            // alert("wechat_login Failed: " + JSON.stringify(error));
                             $state.go("loginAccount",{wechat:response.code})
                             //window.location.href="#/account/loginAccount?wechat=$scope.wecaht";
                         });

+ 2 - 3
miaomiao/www/js/services/userservice.js

xqd
@@ -1,11 +1,10 @@
 (function (app) {
     app.factory('userService', ['$http', 'config', "util", 'storage', function ($http, config, util, storage) {
         return {
-            loginbywx:function(wechat){
+            wechat_login:function(wechat){
                 return $http({
-                    url: config.server + 'api/auth/wechat_login',
+                    url: config.server + 'api/auth/wechat_login?wechat=' + wechat,
                     method: "get",
-                    data: { wechat: wechat}
                 })
             },
             login: function (phone, verify_code,wechat) {

+ 1 - 2
miaomiao/www/templates/account/login.html

xqd
@@ -4,8 +4,7 @@
             <img ng-src="img/icon_login.svg"  style="margin:0 auto;display:block;width:100px;border-radius:50px"/>
             <span style="font-size: 15px; color: #E1E1E1; margin-top: 30px">- 微信登录 -</span>
             <div class="lgsocial">
-                <!--<img  ng-src="img/icon_weibo.svg"/>-->
-                <img ng-click="loginbywx()" ng-src="img/icon_wechat.svg"/>
+                <img ng-click="wechat_login()" ng-src="img/icon_wechat.svg"/>
             </div>
         </div>
     </ion-content>