瀏覽代碼

统一微信登录

seimin 3 年之前
父節點
當前提交
67ca319913
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      src/views/Login.vue

+ 2 - 4
src/views/Login.vue

@@ -46,7 +46,7 @@ export default {
46
     // 登陆
46
     // 登陆
47
     login() {
47
     login() {
48
       var that = this;
48
       var that = this;
49
-      that.$http.post("service/auth/wechatlogin", {}).then(function(res) {
49
+      that.$http.post("service/auth/wechatAuth", {}).then(function(res) {
50
         if (res.data.url) {
50
         if (res.data.url) {
51
           window.location.href = res.data.url;
51
           window.location.href = res.data.url;
52
         } else {
52
         } else {
@@ -69,8 +69,6 @@ export default {
69
     getCode() {
69
     getCode() {
70
       var that = this;
70
       var that = this;
71
       var url = window.location.href.split("?");
71
       var url = window.location.href.split("?");
72
-      // alert("window.location.href----:");
73
-      // alert(JSON.stringify(window.location.href));
74
       if (!url[1]) {
72
       if (!url[1]) {
75
         that.login();
73
         that.login();
76
       } else {
74
       } else {
@@ -80,7 +78,7 @@ export default {
80
         };
78
         };
81
         // alert("2--传code参数:");
79
         // alert("2--传code参数:");
82
         // alert(JSON.stringify(code));
80
         // alert(JSON.stringify(code));
83
-        that.$http.post("service/auth/wechatlogin2", code).then(function(res) {
81
+        that.$http.post("service/auth/wechatLoginEncrypt", code).then(function(res) {
84
           if (res.data.state == 200) {
82
           if (res.data.state == 200) {
85
             // alert(3);
83
             // alert(3);
86
             // alert(JSON.stringify(res.data));
84
             // alert(JSON.stringify(res.data));