接口域名更改,取消H5域名跨域配置
parent
8e65b1c87b
commit
476de6e246
6
App.vue
6
App.vue
|
@ -10,12 +10,10 @@
|
|||
onLaunch: function() {
|
||||
// 配置全局域名
|
||||
// #ifdef APP-PLUS
|
||||
// uni.setStorageSync('hostapi','http://maintain.7and5.cn');
|
||||
getApp().globalData.hostapi = 'http://maintain.7and5.cn';
|
||||
getApp().globalData.hostapi = 'https://7and5.cn';
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
// uni.setStorageSync('hostapi','http://maintain.7and5.cn');
|
||||
this.globalData.hostapi = 'http://maintain.7and5.cn';
|
||||
this.globalData.hostapi = 'https://7and5.cn';
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// uni.setStorageSync('hostapi','/web');
|
||||
|
|
|
@ -3,13 +3,14 @@ const ENV = process.env.NODE_ENV;
|
|||
console.log(ENV,'当前环境'); // development:开发环境 test:测试环境 production:生产环境
|
||||
// 配置全局域名
|
||||
// #ifdef APP-PLUS
|
||||
const hostapi = 'http://maintain.7and5.cn';
|
||||
const hostapi = 'https://7and5.cn';
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
const hostapi = 'http://maintain.7and5.cn';
|
||||
const hostapi = 'https://7and5.cn';
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
const hostapi = '/web';
|
||||
// const hostapi = '/web';
|
||||
const hostapi = 'https://7and5.cn';
|
||||
// #endif
|
||||
// 清理所有缓存并前往授权页
|
||||
const goLogin = () => {
|
||||
|
@ -88,11 +89,14 @@ const request = (method, url, options) => {
|
|||
if(options!=undefined) params = options;
|
||||
// params.token = uni.getStorageSync('token');
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(hostapi,91);
|
||||
uni.request({
|
||||
url: `${hostapi}${url}`,
|
||||
method: methods,
|
||||
data: params,
|
||||
header: headers,
|
||||
// sslVerify:false,//验证 ssl 证书 仅App安卓端支持
|
||||
// withCredentials:true,//跨域请求时是否携带凭证(cookies)仅H5支持
|
||||
success: res => {
|
||||
console.log(`${url}返的结果===>`,res);
|
||||
if (res.statusCode == 200) {
|
||||
|
@ -117,7 +121,6 @@ const request = (method, url, options) => {
|
|||
// 上传文件 封装请求
|
||||
const uploadFile = (url, options) => {
|
||||
let tempData = options || {}
|
||||
console.log(tempData,108);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${hostapi}${url}`,
|
||||
|
@ -125,6 +128,8 @@ const uploadFile = (url, options) => {
|
|||
name: 'image',
|
||||
fileType:'image',
|
||||
formData: tempData,
|
||||
// sslVerify:false,//验证 ssl 证书 仅App安卓端支持
|
||||
// withCredentials:true,//跨域请求时是否携带凭证(cookies)仅H5支持
|
||||
header: {
|
||||
'Content-Type': 'multipart/form-data;charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || '',
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
"https" : false,
|
||||
"proxy" : {
|
||||
"/web" : {
|
||||
"target" : "http://maintain.7and5.cn",
|
||||
"target" : "https://7and5.cn",
|
||||
"changeOrigin" : true,
|
||||
"secure" : false,
|
||||
"pathRewrite" : {
|
||||
|
|
|
@ -59,8 +59,7 @@
|
|||
<!-- <cmd-progress type="circle" :percent="item.num" :width="60" :stroke-color="['#00a2e9','#e87c00','#0b56ec'][index]" :circleStrokeColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]" :strokeShape="'square'"></cmd-progress> -->
|
||||
<arprogress :percent="item.num" :inactiveColor="['#c6e6f5','#f4dfc6','#c8d7f5'][index]"
|
||||
:activeColor="['#00a2e9','#e87c00','#0b56ec'][index]" :borderWidth="7.8" :width="120"
|
||||
:duration="500" bgColor="transparent"><text
|
||||
:style="{color: ['#00a2e9','#e87c00','#0b56ec'][index]}">{{item.num}}%</text>
|
||||
:duration="500" bgColor="transparent"><text :style="{color: ['#00a2e9','#e87c00','#0b56ec'][index]}">{{item.num}}%</text>
|
||||
</arprogress>
|
||||
<view class="fon24 mar-s20">{{item.title}}</view>
|
||||
</view>
|
||||
|
@ -123,15 +122,15 @@
|
|||
],
|
||||
percentageList: [{
|
||||
title: '预约及时率',
|
||||
num: 100
|
||||
num: 0
|
||||
},
|
||||
{
|
||||
title: '上门准时率',
|
||||
num: 60
|
||||
num: 0
|
||||
},
|
||||
{
|
||||
title: '项目报修率',
|
||||
num: 40
|
||||
num: 0
|
||||
},
|
||||
],
|
||||
gridList: [{
|
||||
|
@ -197,13 +196,6 @@
|
|||
this.$toolAll.tools.showToast('退出成功');
|
||||
// 清除所有缓存
|
||||
uni.clearStorageSync();
|
||||
// 配置全局域名
|
||||
// #ifdef APP-PLUS
|
||||
uni.setStorageSync('hostapi', 'http://maintain.7and5.cn');
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
uni.setStorageSync('hostapi', '/web');
|
||||
// #endif
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
|
|
Loading…
Reference in New Issue