develop
xiaozhiyong 11 months ago
parent 4fd0b3eed1
commit 8afc6deaf8
  1. 2
      src/App.vue
  2. 8
      src/api/login/index.js
  3. 2
      src/manifest.json
  4. 49
      src/subPackages/login/login/index.vue
  5. 4
      src/utils/request.js

@ -6,7 +6,7 @@ export default {
latitude: 39.5426, latitude: 39.5426,
longitude: 116.23292, longitude: 116.23292,
}, },
appId: "wx9995c9f495efa82e", appId: "wxed3e2914d6aa4d52",
hasLocationAuth: true, hasLocationAuth: true,
}, },
onLaunch: function () { onLaunch: function () {

@ -25,17 +25,17 @@ export default {
}); });
}, },
// 获取短信验证码 // 获取短信验证码
verifyCodeLoginCheckAccountPersonal(params) { getVerifyCode(params) {
return request({ return request({
url: "/guest-identity/unionAuth/verifyCodeLoginCheckAccountPersonal", url: "/guest-identity/unionAuth/getVerifyCode",
method: "post", method: "post",
data: params, data: params,
}); });
}, },
// 验证码登录 // 验证码登录
verifyCodeLoginPersonal(params) { verifyCodeRegister(params) {
return request({ return request({
url: "/guest-identity/unionAuth/verifyCodeLoginPersonal", url: "/guest-identity/unionAuth/verifyCodeRegister",
method: "post", method: "post",
data: params, data: params,
}); });

@ -57,7 +57,7 @@
/* */ /* */
}, },
"mp-weixin": { "mp-weixin": {
/* */ "appid": "wx9995c9f495efa82e", /* */ "appid": "wxed3e2914d6aa4d52",
"setting": { "setting": {
"urlCheck": false "urlCheck": false
}, },

@ -125,26 +125,24 @@ export default {
obtainCode() { obtainCode() {
if (this.countdown.num != 60) return; if (this.countdown.num != 60) return;
if (!this.checkParams(["username"])) return; if (!this.checkParams(["username"])) return;
serve.getVerifyCode({ username: this.params.username }).then((res) => {
if (res.code == 20000) {
uni.showToast({
title: res.msg,
icon: "none",
});
this.params.verifyCodeToken = res.data.verifyCodeToken;
let instance = setInterval(() => { let instance = setInterval(() => {
if (!this.countdown.num) { if (!this.countdown.num) {
clearInterval(instance); clearInterval(instance);
this.countdown.num = 60; this.countdown.num = 60;
return; return;
}
this.countdown.num -= 1;
}, 1000);
} }
this.countdown.num -= 1; });
}, 1000);
serve
.verifyCodeLoginCheckAccountPersonal({ username: this.params.username })
.then((res) => {
if (res.code == 20000) {
uni.showToast({
title: res.msg,
});
this.params.verifyCodeToken = res.data.verifyCodeToken;
}
});
}, },
// //
loginPersonal() { loginPersonal() {
@ -183,11 +181,16 @@ export default {
realLogin() { realLogin() {
if (!this.checkParams(["username", "verifyCode"])) return; if (!this.checkParams(["username", "verifyCode"])) return;
serve.verifyCodeLoginPersonal(this.params).then((res) => { serve
if (res.code === 20000) { .verifyCodeRegister({
this.callbackLogin(res); unionId: uni.getStorageSync("unionid"),
} ...this.params,
}); })
.then((res) => {
if (res.code === 20000) {
this.callbackLogin(res);
}
});
}, },
bindLoginByPhonePersonal(detail) { bindLoginByPhonePersonal(detail) {
const params = { const params = {

@ -3,8 +3,8 @@ import axiosMiniprogramAdapter from "axios-miniprogram-adapter";
import utils from "@/utils/encode"; import utils from "@/utils/encode";
let env; let env;
env = "test"; env = "test";
env = "production"; // env = "production";
let testUrl = "http://192.168.110.77:38080"; let testUrl = "http://192.168.110.230:38080";
let productUrl = "http://uat.xingoil.com/guest-api"; let productUrl = "http://uat.xingoil.com/guest-api";
// let productUrl = "https://www.xingoil.com/adminapi"; // let productUrl = "https://www.xingoil.com/adminapi";

Loading…
Cancel
Save