添加微信手机号授权登录
This commit is contained in:
parent
213a31de4d
commit
1c5f79f32e
|
|
@ -53,6 +53,7 @@
|
|||
<text>注册</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="wxbtn">
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="value==1">
|
||||
<view>
|
||||
|
|
@ -67,6 +68,7 @@
|
|||
<text>手机号快捷登录</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -82,10 +84,13 @@
|
|||
second: 60,
|
||||
value: 0,
|
||||
isCode: true,
|
||||
loginCode: ""
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP-WEIXIN
|
||||
this.login()
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
// 勾选协议
|
||||
|
|
@ -181,15 +186,7 @@
|
|||
success(res) {
|
||||
if (res.code) {
|
||||
if (res.errMsg = "login:ok") {
|
||||
that.$model.onlogin({
|
||||
code: res.code,
|
||||
userid: ""
|
||||
}).then(res => {
|
||||
if (res.code == 2) {
|
||||
that.sessionid = res.data.sessionid
|
||||
return
|
||||
}
|
||||
}).catch(e => {})
|
||||
that.loginCode = res.code
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -199,8 +196,8 @@
|
|||
getPhoneNumber(res) {
|
||||
const that = this
|
||||
if (res.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
this.$model.getregister({
|
||||
sessionId: uni.getStorageSync('sessionid'),
|
||||
this.$model.getRegisterPhone({
|
||||
code: that.loginCode,
|
||||
encryptedData: res.detail.encryptedData,
|
||||
iv: res.detail.iv,
|
||||
}).then(res => {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ export default {
|
|||
return res
|
||||
})
|
||||
},
|
||||
getRegisterPhone(param) { // 手机号快捷登录
|
||||
return http.post("/wechat_quick_login", param).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
getdeleteAccount(param) { // 删除用户
|
||||
return http.post("/delete_account", param).then(res => {
|
||||
return res
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -29654,7 +29654,7 @@ if(false) {}
|
|||
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ./node_modules/css-loader/dist/runtime/api.js */ 13);
|
||||
exports = ___CSS_LOADER_API_IMPORT___(false);
|
||||
// Module
|
||||
exports.push([module.i, "@charset \"UTF-8\";\n/* 主题色 */\n.bg[data-v-942944ba] {\n position: absolute;\n top: 0;\n width: 100%;\n height: 50vh;\n z-index: 9;\n background: #37cc92;\n}\n.top[data-v-942944ba] {\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n position: relative;\n top: 70px;\n z-index: 99;\n margin-bottom: 15px;\n}\n.top uni-image[data-v-942944ba] {\n width: 70px;\n height: 70px;\n margin: auto;\n margin-bottom: 10px;\n border-radius: 50%;\n}\n.top uni-text[data-v-942944ba] {\n color: #fff;\n display: block;\n width: 100%;\n font-size: 18px;\n text-align: center;\n font-weight: bold;\n}\n.login[data-v-942944ba] {\n width: 86%;\n height: auto;\n background: #fff;\n border-radius: 10px;\n padding: 10px 0;\n background-color: #fff;\n z-index: 99;\n position: absolute;\n left: 7%;\n top: 28%;\n box-shadow: 0px 1px 5px 2px #dfe2e1fc;\n}\n.login .title[data-v-942944ba] {\n text-align: left;\n color: #333;\n font-size: 40rpx;\n font-weight: bold;\n margin-bottom: 15px;\n margin-left: 15px;\n}\n.login .toggle[data-v-942944ba] {\n position: absolute;\n right: 15px;\n top: 20px;\n}\n.login .editem[data-v-942944ba] {\n position: relative;\n display: flex;\n align-items: center;\n font-size: 32rpx;\n margin: 0 15px;\n justify-content: space-between;\n flex-wrap: wrap;\n}\n.login .editem .item[data-v-942944ba] {\n width: 100%;\n margin-bottom: 15px;\n}\n.login .editem .item .text[data-v-942944ba] {\n font-size: 32rpx;\n margin-bottom: 10px;\n}\n.login .editem .item .input[data-v-942944ba] {\n height: 35px;\n line-height: 35px;\n display: flex;\n position: relative;\n border: #dfdfdf 1px solid;\n padding: 0 10px;\n border-radius: 5px;\n}\n.login .editem .item uni-input[data-v-942944ba] {\n height: 40px;\n line-height: 40px;\n position: absolute;\n left: 10px;\n right: 0px;\n z-index: 88;\n font-size: 32rpx;\n}\n.login .editem .item .yanzhengma uni-input[data-v-942944ba] {\n right: 240rpx;\n font-size: 32rpx;\n}\n.login .editem .code[data-v-942944ba] {\n width: 220rpx;\n background: #dfdfdf;\n font-size: 28rpx;\n margin: 0;\n line-height: 40px;\n border-radius: 5px;\n text-align: center;\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n z-index: 99;\n}\n.login .editem .forget[data-v-942944ba] {\n width: 100%;\n font-size: 28rpx !important;\n background: #fff;\n color: #37cc92;\n text-align: right;\n}\n.login .editem .forget uni-text[data-v-942944ba] {\n width: 100px;\n text-align: right;\n}\n.login .btngroup[data-v-942944ba] {\n height: 35px;\n line-height: 35px;\n display: flex;\n margin: 0 15px;\n justify-content: center;\n}\n.login .btngroup uni-text[data-v-942944ba] {\n display: block;\n color: #37cc92;\n}\n.login .btnlogin[data-v-942944ba] {\n width: calc(100% - 30px);\n margin: 15px;\n height: 42px;\n line-height: 42px;\n background: #fea606;\n font-weight: 700;\n border-radius: 15px;\n text-align: center;\n color: #fff !important;\n}\n.xieyi[data-v-942944ba] {\n font-size: 32rpx;\n color: #37cc92;\n margin-left: 10px;\n}\n.xieyi uni-text[data-v-942944ba] {\n border-bottom: 1px solid #37cc92;\n}\n.content[data-v-942944ba] {\n width: 100%;\n height: 100vh;\n}\n.xieyi[data-v-942944ba] {\n font-size: 28rpx;\n color: #999;\n margin-left: 10px;\n}\n.xieyi uni-text[data-v-942944ba] {\n color: #37cc92;\n}\n.href[data-v-942944ba] {\n width: auto;\n}\n", ""]);
|
||||
exports.push([module.i, "@charset \"UTF-8\";\n/* 主题色 */\n.bg[data-v-942944ba] {\n position: absolute;\n top: 0;\n width: 100%;\n height: 50vh;\n z-index: 9;\n background: #37cc92;\n}\n.top[data-v-942944ba] {\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n position: relative;\n top: 70px;\n z-index: 99;\n margin-bottom: 15px;\n}\n.top uni-image[data-v-942944ba] {\n width: 70px;\n height: 70px;\n margin: auto;\n border-radius: 50%;\n}\n.top uni-text[data-v-942944ba] {\n color: #fff;\n display: block;\n width: 100%;\n font-size: 18px;\n text-align: center;\n font-weight: bold;\n}\n.login[data-v-942944ba] {\n width: 86%;\n height: auto;\n background: #fff;\n border-radius: 10px;\n padding: 10px 0;\n background-color: #fff;\n z-index: 99;\n position: absolute;\n left: 7%;\n top: 27%;\n box-shadow: 0px 1px 5px 2px #dfe2e1fc;\n}\n.login .title[data-v-942944ba] {\n text-align: left;\n color: #333;\n font-size: 40rpx;\n font-weight: bold;\n margin-bottom: 15px;\n margin-left: 15px;\n}\n.login .toggle[data-v-942944ba] {\n position: absolute;\n right: 15px;\n top: 20px;\n}\n.login .editem[data-v-942944ba] {\n position: relative;\n display: flex;\n align-items: center;\n font-size: 32rpx;\n margin: 0 15px;\n justify-content: space-between;\n flex-wrap: wrap;\n}\n.login .editem .item[data-v-942944ba] {\n width: 100%;\n margin-bottom: 15px;\n}\n.login .editem .item .text[data-v-942944ba] {\n font-size: 32rpx;\n margin-bottom: 10px;\n}\n.login .editem .item .input[data-v-942944ba] {\n height: 35px;\n line-height: 35px;\n display: flex;\n position: relative;\n border: #dfdfdf 1px solid;\n padding: 0 10px;\n border-radius: 5px;\n}\n.login .editem .item uni-input[data-v-942944ba] {\n height: 40px;\n line-height: 40px;\n position: absolute;\n left: 10px;\n right: 0px;\n z-index: 88;\n font-size: 32rpx;\n}\n.login .editem .item .yanzhengma uni-input[data-v-942944ba] {\n right: 240rpx;\n font-size: 32rpx;\n}\n.login .editem .code[data-v-942944ba] {\n width: 220rpx;\n background: #dfdfdf;\n font-size: 28rpx;\n margin: 0;\n line-height: 40px;\n border-radius: 5px;\n text-align: center;\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n z-index: 99;\n}\n.login .editem .forget[data-v-942944ba] {\n width: 100%;\n font-size: 28rpx !important;\n background: #fff;\n color: #37cc92;\n text-align: right;\n}\n.login .editem .forget uni-text[data-v-942944ba] {\n width: 100px;\n text-align: right;\n}\n.login .btngroup[data-v-942944ba] {\n height: 35px;\n line-height: 35px;\n display: flex;\n margin: 0 15px;\n justify-content: center;\n}\n.login .btngroup uni-text[data-v-942944ba] {\n display: block;\n color: #37cc92;\n}\n.login .btnlogin[data-v-942944ba] {\n width: calc(100% - 30px);\n margin: 15px;\n height: 42px;\n line-height: 42px;\n background: #fea606;\n font-weight: 700;\n border-radius: 15px;\n text-align: center;\n color: #fff !important;\n}\n.xieyi[data-v-942944ba] {\n font-size: 32rpx;\n color: #37cc92;\n margin-left: 10px;\n}\n.xieyi uni-text[data-v-942944ba] {\n border-bottom: 1px solid #37cc92;\n}\n.content[data-v-942944ba] {\n width: 100%;\n height: 100vh;\n}\n.xieyi[data-v-942944ba] {\n font-size: 28rpx;\n color: #999;\n margin-left: 10px;\n}\n.xieyi uni-text[data-v-942944ba] {\n color: #37cc92;\n}\n.href[data-v-942944ba] {\n width: auto;\n}\n.wxbtn[data-v-942944ba] {\n width: 100%;\n position: absolute;\n margin-top: 30px;\n top: 80%;\n}\n.wxbtn uni-icon[data-v-942944ba] {\n font-size: 25px;\n color: #28c445;\n}\n.wxbtn uni-text[data-v-942944ba] {\n display: block;\n margin-top: 5px;\n font-size: 12px;\n text-align: center;\n border-bottom: 1px solid blue;\n color: blue;\n}\n.wxbtn uni-button[data-v-942944ba] {\n line-height: initial;\n background: #fff;\n display: flex;\n flex-wrap: wrap;\n padding: 0;\n justify-content: center;\n}\n.wxbtn uni-button[data-v-942944ba]::after {\n display: none;\n}\n.wxbtn uni-view[data-v-942944ba] {\n width: 100%;\n}\n.wxbtn uni-image[data-v-942944ba] {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n}\n", ""]);
|
||||
// Exports
|
||||
module.exports = exports;
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
|
|
@ -11211,6 +11211,12 @@ var _default = {
|
|||
return res;
|
||||
});
|
||||
},
|
||||
getRegisterPhone: function getRegisterPhone(param) {
|
||||
// 手机号快捷登录
|
||||
return _https.default.post("/wechat_quick_login", param).then(function (res) {
|
||||
return res;
|
||||
});
|
||||
},
|
||||
getdeleteAccount: function getdeleteAccount(param) {
|
||||
// 删除用户
|
||||
return _https.default.post("/delete_account", param).then(function (res) {
|
||||
|
|
|
|||
|
|
@ -214,6 +214,8 @@ exports.default = void 0;
|
|||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
var _default = {
|
||||
data: function data() {
|
||||
return {
|
||||
|
|
@ -223,7 +225,8 @@ var _default = {
|
|||
disabled: false,
|
||||
second: 60,
|
||||
value: 0,
|
||||
isCode: true
|
||||
isCode: true,
|
||||
loginCode: ""
|
||||
};
|
||||
},
|
||||
onLoad: function onLoad() {
|
||||
|
|
@ -323,15 +326,7 @@ var _default = {
|
|||
success: function success(res) {
|
||||
if (res.code) {
|
||||
if (res.errMsg = "login:ok") {
|
||||
that.$model.onlogin({
|
||||
code: res.code,
|
||||
userid: ""
|
||||
}).then(function (res) {
|
||||
if (res.code == 2) {
|
||||
that.sessionid = res.data.sessionid;
|
||||
return;
|
||||
}
|
||||
}).catch(function (e) {});
|
||||
that.loginCode = res.code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -341,8 +336,8 @@ var _default = {
|
|||
getPhoneNumber: function getPhoneNumber(res) {
|
||||
var that = this;
|
||||
if (res.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
this.$model.getregister({
|
||||
sessionId: uni.getStorageSync('sessionid'),
|
||||
this.$model.getRegisterPhone({
|
||||
code: that.loginCode,
|
||||
encryptedData: res.detail.encryptedData,
|
||||
iv: res.detail.iv
|
||||
}).then(function (res) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue