From bf5ad8ee091a96f2fe6200c9fd2e2d05ecad3049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Fri, 30 Mar 2018 14:32:57 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/axiosPlugin.js | 3 +- fangija-zsyf/views/user/passLogin.html | 159 +++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 fangija-zsyf/views/user/passLogin.html diff --git a/fangija-zsyf/js/axiosPlugin.js b/fangija-zsyf/js/axiosPlugin.js index bfa7c47..8bfca8b 100644 --- a/fangija-zsyf/js/axiosPlugin.js +++ b/fangija-zsyf/js/axiosPlugin.js @@ -3,7 +3,8 @@ axios.defaults.headers.post['Content-Type'] = 'application/json'; // 添加请求拦截器 axios.interceptors.request.use(function (config) { - config.headers.Authorization = '111111111' + var token = localStorage.getItem("user_token"); + config.headers.Authorization = token return config; }, function (error) { return Promise.reject(error); diff --git a/fangija-zsyf/views/user/passLogin.html b/fangija-zsyf/views/user/passLogin.html new file mode 100644 index 0000000..a2c35e6 --- /dev/null +++ b/fangija-zsyf/views/user/passLogin.html @@ -0,0 +1,159 @@ + + + + + + +账号密码登录 + + + + + + + + + + + + + +
+
+
+ +

账号密码登录

+
+
+ + +
+

+ 第三方登录 +

+

+ + + +

+
+
+
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file From 34a1e76c0e11db07601648703c3bd42d55a27893 Mon Sep 17 00:00:00 2001 From: hubingliang Date: Fri, 30 Mar 2018 14:34:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB?= =?UTF-8?q?=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/login/codeSms.js | 35 +++++++++++++++------------- fangija-zsyf/js/login/wxLogin.js | 8 +++++++ fangija-zsyf/views/user/codeSms.html | 18 ++++++++++---- 3 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 fangija-zsyf/js/login/wxLogin.js diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index 3258408..5deeffc 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -61,20 +61,23 @@ $("#login_btn").on("click", function () { var phoneNum = $("#input_phoneNumber").val(); var code = $("#input_codeSms").val(); var protocal = $(".check").find(".checkImg").css("display"); - if(phoneNum == ""){ - $.toast("请输入手机号码"); - return false; - } - if(code == ""){ - $.toast("请输入验证码"); - return false; - } - if(protocal != "block"){ - $.toast("请同意服务协议"); - return false; - } - axios.post("/rest/user/sendMobileCode", {mobile: mobile}) - .then(function (response) { - - }) + if(checkPhoneNum(phoneNum)){ + if(code == ""){ + $.toast("请输入验证码"); + return false; + } + if(protocal != "block"){ + $.toast("请同意服务协议"); + return false; + } + axios.post("/rest/user/smsLogin", {mobile: phoneNum,smsCode:code}) + .then(function (response) { + var data = response.data + if(data.status){ + var token = data.data; + }else{ + $.toast("data.message"); + } + }) + } }); diff --git a/fangija-zsyf/js/login/wxLogin.js b/fangija-zsyf/js/login/wxLogin.js new file mode 100644 index 0000000..bcf9faa --- /dev/null +++ b/fangija-zsyf/js/login/wxLogin.js @@ -0,0 +1,8 @@ + +$("#wxLogin").addEventListener('tap',function() { + console.log("微信"); + authLogin('weixin'); +}) +function authLogin(type) { + console.log("hhhhhhhhhhhhhhhhhhh") +} diff --git a/fangija-zsyf/views/user/codeSms.html b/fangija-zsyf/views/user/codeSms.html index 8815ac2..9427781 100644 --- a/fangija-zsyf/views/user/codeSms.html +++ b/fangija-zsyf/views/user/codeSms.html @@ -12,6 +12,7 @@ + @@ -63,7 +64,7 @@ 我已阅读并接受《服务协议》

@@ -71,9 +72,9 @@ 第三方登录

- + - +

@@ -92,13 +93,22 @@ $.config = {router: false} + + + +