yangan
2024-08-31 8d61dc60466e243414d2a05106bf8cf173fb47f0
api/publicInterface.js
@@ -2,14 +2,15 @@
// import login from "../pages/login/login";
import {
   BaseUrl as wrBaseUrl
} from '@/api/request.js'
const BaseUrl = "http://192.168.0.110:9999";
// const BaseUrl = "http://hesuancj.cn:9999"
// const BaseUrl = "https://hesuancj.cn:9095"
// const BaseUrl = "http://192.168.3.119:9999"
import { BaseUrl as wrBaseUrl } from '@/api/request.js'
// const BaseUrl = 'http://192.168.0.12:9999'
// const BaseUrl = 'http://192.168.0.7:9999'
const BaseUrl = 'https://wrzs.czjlchem.com:9090'
// const BaseUrl = 'http://192.168.0.22:9999'
// const BaseUrl = 'https://mx.jzeg.cn:9195'
// const BaseUrl = 'http://192.168.31.17:9999'
// const BaseUrl = 'http://192.168.0.100:9999'
// const BaseUrl = 'http://192.168.0.108:9999'
// 登录
// function apiLogin({
//    code
@@ -61,14 +62,24 @@
   idCard,
   carNo,
   carImg,
   drivingImg
   drivingImg,
   vehicleColour,
   bodyofcarJpg,
   roadTransportImg,
   tradeQualificationImg,
   isCoalCar,
   countryNumberCar,
   inventoryImg
}) {
   uni.showLoading({
      title: "加载中..."
   })
   uni.showLoading({ title: '加载中...' })
   return new Promise((resolve, reject) => {
      uni.request({
         url: wrBaseUrl + '/wrzs/wx/bindWx',
         // #ifdef H5
         url:  '/wrzs/wx/bindWx',
         // #endif
         // #ifndef H5
         url:  wrBaseUrl + '/wrzs/wx/bindWx',
         // #endif
         method: 'POST',
         data: {
            phone,
@@ -80,21 +91,29 @@
            idCard,
            carNo,
            carImg,
            drivingImg
            drivingImg,
            vehicleColour,
            bodyofcarJpg,
            roadTransportImg,
            tradeQualificationImg,
            isCoalCar,
            countryNumberCar,
            inventoryImg
         },
         header: {
            "Authorization": 'Basic c29jaWFsOnNvY2lhbA==', //app:app
            'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app
            'content-type': 'application/json',
            "CLIENT_TOC": "Y",
            "isToken": "false"
            'clientToc': 'Y',
            // '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
@@ -114,8 +133,13 @@
}) {
   return new Promise((resolve, reject) => {
      uni.request({
         url: BaseUrl + "/admin/oauth2/token",
         method: "POST",
         // #ifdef H5
         url: '/admin/oauth2/token',
         // #endif
         // #ifndef H5
         url: BaseUrl + '/admin/oauth2/token',
         // #endif
         method: 'POST',
         data: {
            username,
            password,
@@ -123,18 +147,19 @@
            scope
         },
         header: {
            "Authorization": 'Basic c29jaWFsOnNvY2lhbA==', //app:app
            'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app
            'content-type': 'application/x-www-form-urlencoded',
            "CLIENT_TOC": "Y",
            "isToken": "false"
            'clientToc': 'Y',
            '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: '服务器错误'
@@ -146,34 +171,31 @@
// 微信小程序一键登录
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"
            'clientToc': 'Y',
            // '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: '服务器错误'