| | |
| | | // import {resolve} from "../unpackage/dist/dev/mp-weixin/common/vendor"; |
| | | // import login from "../pages/login/login"; |
| | | |
| | | // const BaseUrl = "http://192.168.3.159:9999/"; |
| | | import { |
| | | BaseUrl as wrBaseUrl |
| | | } from '@/api/request.js' |
| | | const BaseUrl = "http://hesuancj.cn:9999" |
| | | // const BaseUrl = "https://hesuancj.cn:9095" |
| | | // const BaseUrl = "http://10.101.33.114:9999" |
| | | |
| | | import { BaseUrl as wrBaseUrl } from '@/api/request.js' |
| | | // const BaseUrl = 'http://192.168.0.110:9999' |
| | | // const BaseUrl = 'http://192.168.0.102:9999' |
| | | const BaseUrl = 'https://mx.jzeg.cn:9096' |
| | | // const BaseUrl = 'http://192.168.31.18:9999' |
| | | // const BaseUrl = 'http://192.168.0.100:9999' |
| | | // const BaseUrl = 'http://192.168.0.108:9999' |
| | | // 登录 |
| | | // function apiLogin({ |
| | | // code |
| | |
| | | idCard, |
| | | carNo, |
| | | carImg, |
| | | drivingImg |
| | | drivingImg, |
| | | vehicleColour, |
| | | bodyofcarJpg |
| | | }) { |
| | | uni.showLoading({ |
| | | title: "加载中..." |
| | | }) |
| | | console.log(bodyofcarJpg); |
| | | uni.showLoading({ title: '加载中...' }) |
| | | return new Promise((resolve, reject) => { |
| | | uni.request({ |
| | | url: wrBaseUrl + '/wrzs/wx/bindWx', |
| | |
| | | idCard, |
| | | carNo, |
| | | carImg, |
| | | drivingImg |
| | | drivingImg, |
| | | vehicleColour, |
| | | bodyofcarJpg |
| | | }, |
| | | header: { |
| | | "Authorization": 'Basic c29jaWFsOnNvY2lhbA==', //app:app |
| | | 'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app |
| | | 'content-type': 'application/json', |
| | | "CLIENT_TOC": "Y", |
| | | "isToken": "false" |
| | | 'CLIENT_TOC': 'Y', |
| | | 'isToken': 'false' |
| | | }, |
| | | success: (res) => { |
| | | uni.hideLoading(); |
| | | success: res => { |
| | | uni.hideLoading() |
| | | resolve(res) |
| | | }, |
| | | fail: (err) => { |
| | | console.log('错误', err); |
| | | uni.hideLoading(); |
| | | fail: err => { |
| | | console.log('错误', err) |
| | | uni.hideLoading() |
| | | uni.showModal({ |
| | | title: '服务器错误', |
| | | icon: null |
| | |
| | | }) { |
| | | return new Promise((resolve, reject) => { |
| | | uni.request({ |
| | | url: BaseUrl + "/admin/oauth2/token", |
| | | method: "POST", |
| | | url: BaseUrl + '/admin/oauth2/token', |
| | | method: 'POST', |
| | | data: { |
| | | username, |
| | | password, |
| | |
| | | scope |
| | | }, |
| | | header: { |
| | | "Authorization": 'Basic c29jaWFsOnNvY2lhbA==', //app:app |
| | | 'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app |
| | | 'content-type': 'application/x-www-form-urlencoded', |
| | | "CLIENT_TOC": "Y", |
| | | "isToken": "false" |
| | | 'CLIENT_TOC': 'Y', |
| | | 'isToken': 'false' |
| | | }, |
| | | success: (res) => { |
| | | uni.hideLoading(); |
| | | resolve(res.data); |
| | | success: res => { |
| | | uni.hideLoading() |
| | | resolve(res.data) |
| | | }, |
| | | fail: (err) => { |
| | | console.log('错误', err); |
| | | uni.hideLoading(); |
| | | fail: err => { |
| | | console.log('错误', err) |
| | | uni.hideLoading() |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '服务器错误' |
| | |
| | | |
| | | |
| | | // 微信小程序一键登录 |
| | | function apiLoginWx({ |
| | | code |
| | | }) { |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }) |
| | | function apiLoginWx({ code }) { |
| | | uni.showLoading({ title: '加载中...' }) |
| | | return new Promise((resolve, reject) => { |
| | | uni.request({ |
| | | url: BaseUrl + '/admin/oauth2/token', |
| | | method: "POST", |
| | | method: 'POST', |
| | | data: { |
| | | grant_type: 'mobile', |
| | | mobile: `MINI@${code}`, |
| | | code |
| | | }, |
| | | header: { |
| | | "Authorization": 'Basic c29jaWFsOnNvY2lhbA==', //app:app |
| | | 'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app |
| | | 'content-type': 'application/x-www-form-urlencoded', |
| | | "CLIENT_TOC": "Y", |
| | | "isToken": "false" |
| | | 'CLIENT_TOC': 'Y', |
| | | 'isToken': 'false' |
| | | }, |
| | | success: (res) => { |
| | | uni.hideLoading(); |
| | | success: res => { |
| | | uni.hideLoading() |
| | | resolve(res.data) |
| | | }, |
| | | fail: (err) => { |
| | | console.log('错误', err); |
| | | uni.hideLoading(); |
| | | fail: err => { |
| | | console.log('错误', err) |
| | | uni.hideLoading() |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '服务器错误' |
| | |
| | | apiRegister, |
| | | apiLoginPassword, |
| | | BaseUrl |
| | | } |
| | | } |