12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import {
- request
- } from '@/utils/request'
- const getZFBThree = function(callback = null) {
- my.getAuthCode({
- scopes: 'auth_user',
- success: function(res) {
- const authCode = res.authCode
- uni.showLoading({
- title: "加载中..."
- })
- request({
- url: 'https://ldb-permit.hz-hanghui.com:8088/hanghui/outapi/alipayApi/faceAuth/common/getAlipayUserInfo',
- method: 'POST',
- data: {
- authCode: authCode,
- appId: getApp().globalData.appId
- },
- dataType: 'json',
- header: {
- 'Content-type': 'application/json'
- },
- success: res => {
- uni.hideLoading()
- const result = {}
- if (res.data) {
- result.code = 200
- result.data = {
- username: res.data.userName,
- idNumber: res.data.certNo,
- phone: res.data.mobile,
- userId: res.data.userId,
- avatar: res.data.avatar || null,
- personPictures: res.data.personPictures || null,
- photoBase64: res.data.photoBase64 || null
- }
- result.msg = '授权成功!'
- } else {
- result.code = 500
- result.data = null
- result.msg = res.errmsg || '授权失败!'
- }
- if (callback) {
- callback(result)
- }
- },
- fail: res => {
- uni.hideLoading()
- }
- })
- }
- })
- }
- module.exports = {
- getZFBThree
- }
|