panxingxin 5 anos atrás
pai
commit
4f354e5859

+ 9 - 8
api/request.js

@@ -1,5 +1,5 @@
-var Fly = require("../lib/wx.umd.min") //wx.js is your downloaded code
-var fly = new Fly(); //Create an instance of Fly
+const  Fly = require("../lib/wx.umd.min") //wx.js is your downloaded code
+const  fly = new Fly(); //Create an instance of Fly
 const app = getApp()
 
 //设置超时
@@ -10,12 +10,13 @@ import whiteList from './whiteList';
 
 // Add interceptors
 fly.interceptors.request.use((request) => {
-  wx.showLoading({
-    title: '加载中',
-    mask: true
-  })
+// console.log('进入fly-request', request);
+wx.showLoading({
+  'title': '加载中',
+  'mask': true
+});
   // 不显示加载页面的接口
-  if (whiteList.loading.indexOf(request.url) === -1) {
+  if (request.url.indexOf(whiteList.loading) === -1) {
     // 隐藏loading遮罩
     wx.hideLoading();
   }
@@ -111,6 +112,6 @@ fly.interceptors.response.use(
   }
 )
 // Set the base url
-fly.config.baseURL = "http://192.168.20.52:9999"
+fly.config.baseURL = "https://wx.sgsino.cn"
 
 export default fly;

+ 2 - 1
api/whiteList.js

@@ -9,6 +9,7 @@ export default {
   ],
   // 不带token的url
   nullHeaderToken: [
-    '/user/weChatLogin'
+    'weixinlogin'
+    //'/user/weChatLogin'
   ]
 }

+ 0 - 1
models/dataModel.js

@@ -1,5 +1,4 @@
 import fly from '../api/request.js'
-
 // 用户登录
 export function userLogin(code) {
   return fly.request({

+ 2 - 1
pages/contract/detail.js

@@ -1,4 +1,5 @@
 import * as requestAPI from '../../models/dataModel'
+import baseURL from '../../api/baseUrlConfig.js'
 Page({
   data: {
     contractDetail: {},
@@ -119,7 +120,7 @@ Page({
       success(res) {
         for (let i of res.tempFilePaths) {
           wx.uploadFile({
-            url: `http://192.168.20.52:9999/inventory/supplier/contract/qalog/upload/picture?sscId=${_this.data.sscId}&pId=${_this.data.pId}`, //此处换上你的接口地址 
+            url: baseURL.mainUrl + `/inventory/supplier/contract/qalog/upload/picture?sscId=${_this.data.sscId}&pId=${_this.data.pId}`, //此处换上你的接口地址 
             filePath: i,
             name: 'file',
             header: {

+ 1 - 1
pages/login/login.wxml

@@ -22,7 +22,7 @@
 		<!-- <view class="line"></view> -->
 		<!--按钮-->
 		<view class="loginBtnView" hidden="{{!ifUser}}">
-			<button class="loginBtn" type="primary" bindtap="login">一键登录</button>
+			<button  open-type="getUserInfo" class="loginBtn" type="primary" bindgetuserinfo="login">授权登录</button>
 		</view>
 		<view class="loginBtnView" hidden="{{ifUser}}">
 			<button class="loginBtn" type="primary" bindtap="register">注册</button>

+ 2 - 1
pages/qc/detail.js

@@ -1,4 +1,5 @@
 import * as requestAPI from '../../models/dataModel'
+import baseURL from '../../api/baseUrlConfig.js'
 Page({
   data: {
     qcDetail: {},
@@ -119,7 +120,7 @@ Page({
       success(res) {
         for (let i of res.tempFilePaths) {
           wx.uploadFile({
-            url: `http://192.168.20.52:9999/inventory/qc/qclog/upload/picture?sscId=${_this.data.sscId}&pId=${_this.data.pId}`, //此处换上你的接口地址 
+            url: baseURL.mainUrl + `/inventory/qc/qclog/upload/picture?sscId=${_this.data.sscId}&pId=${_this.data.pId}`, //此处换上你的接口地址 
             filePath: i,
             name: 'file',
             header: {

+ 1 - 1
pages/qc/list.js

@@ -123,7 +123,7 @@ Page({
       wx.showToast({
         title: `生成报告${res.data.data}`,
         icon: 'success',
-        duration: 3000
+        duration: 30000
       })
       wx.removeStorageSync('selectQcList')
       setTimeout(() => {

+ 2 - 1
pages/sample/detail.js

@@ -1,4 +1,5 @@
 import * as requestAPI from '../../models/dataModel'
+import baseURL from '../../api/baseUrlConfig.js'
 Page({
   data: {
     sampleDetail: {},
@@ -115,7 +116,7 @@ Page({
       success(res) {
         for (let i of res.tempFilePaths) {
           wx.uploadFile({
-            url: `http://192.168.20.52:9999/inventory/sample/qalog/upload/picture?sdpId=${_this.data.sdpId}`, //此处换上你的接口地址 
+            url: baseURL.mainUrl +  `/inventory/sample/qalog/upload/picture?sdpId=${_this.data.sdpId}`, //此处换上你的接口地址 
             filePath: i,
             name: 'file',
             header: {

+ 4 - 2
project.config.json

@@ -4,7 +4,7 @@
 		"ignore": []
 	},
 	"setting": {
-		"urlCheck": false,
+		"urlCheck": true,
 		"es6": true,
 		"postcss": true,
 		"preloadBackgroundData": false,
@@ -21,7 +21,9 @@
 			"ignore": [],
 			"disablePlugins": [],
 			"outputPath": ""
-		}
+		},
+		"useCompilerModule": false,
+		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.10.4",