|
- var config = require('../../config/config.js');
- const Http = require("../../utils/HttpBasics");
- var app = getApp();
- Page({
- data: {
- canIUse: wx.canIUse('button.open-type.getPhoneNumber')
- },
- onLoad: function(options) {
- var that = this;
- },
- getPhoneNumber: function(e) {
- var that = this;
- var iv = e.detail.iv;
- var encryptedData = e.detail.encryptedData;
- Http.post({
- url: config.api.getUserPhone,
- data: {
- encryptedData: encryptedData,
- iv: iv,
- }
- })
- .then(function(res) {
- console.log(res);
- app.globalData.phone = res.data.phone;
- wx.showToast({
- title: res.data.msg,
- icon: "success",
- success: function(res) {
- wx.redirectTo({
- url: '../login/login',
- })
- }
- })
- },
- function(error) {
- wx.showToast({
- title: '请重新授权手机号',
- icon: "none",
- })
- })
- }
- })
|