配置全局变量

This commit is contained in:
姚亚男
2021-11-01 11:33:52 +08:00
parent 180ea3f9cc
commit fa409f4b4c
16 changed files with 39 additions and 48 deletions
+4 -2
View File
@@ -1,3 +1,5 @@
import {appId, secret} from '../js/project.config'
console.log(appId)
export function wxBind(callback){
// 获取openid进行手机号和微信的绑定
let count = 1
@@ -7,8 +9,8 @@ export function wxBind(callback){
wx.request({
url: 'https://api.weixin.qq.com/sns/jscode2session',
data: {
appid: 'wx457dfcb58fd556ea',
secret: 'e8d2ee25e32c77561efccb7145ba9dc8',
appid: appId,
secret: secret,
js_code: res.code,
grant_type: 'authorization_code'
},
+2 -9
View File
@@ -1,6 +1,6 @@
import http from './http.js'
let baseUrl = http.baseUrl
let URL_CONFIG = http.URL_CONFIG
import { baseUrl, URL_CONFIG } from '../project.config'
/* 配置路径 */
@@ -10,8 +10,6 @@ let apiUrl = {
}
export default {
baseUrl,
URL_CONFIG,
//微信账号密码登陆--1
wxLoginByUserName(option, success, error) {
http.post1(baseUrl + apiUrl.wxLoginByUserName, option).then(res => {
@@ -39,8 +37,3 @@ export default {
})
}
}
export{
baseUrl,
URL_CONFIG
}
+1 -5
View File
@@ -1,4 +1,4 @@
import { baseUrl } from '../project.config'
let headerDefault = {
'Accept': 'application/json'
}
@@ -6,8 +6,6 @@ let headerDefault1 = {
'content-type': 'application/x-www-form-urlencoded'
}
let TokenKey = 'X-Access-Token'
let baseUrl = 'http://bxxt.hzwlsoft.com:1015'
let URL_CONFIG = '/jero-boot/'
const http = (method, url, data, header= headerDefault) => {
let Authorization = wx.getStorageSync(TokenKey) ? wx.getStorageSync(TokenKey) : '';
@@ -39,8 +37,6 @@ const http = (method, url, data, header= headerDefault) => {
}
module.exports = {
baseUrl,
URL_CONFIG,
get: (url, data, header) => http('GET', url, data, header),
post: (url, data, header) => http('POST', url, data, header),
post1: (url, data, header) => http('POST', url, data, headerDefault1),
+1 -1
View File
@@ -1,5 +1,5 @@
import MeetingApi from '../js/http/meetingApi'
import { baseUrl } from '../../assets/js/http/api'
import { baseUrl } from '../js/project.config'
/**
* 预览文件的方法
* @param fileId 文件id
+8
View File
@@ -0,0 +1,8 @@
export const appId = 'wx322b63d1e6ff4765'
export const secret = 'a3e81ffa80aa5f04d0b104b2ccda7f32'
export let baseUrl = 'http://bxxt.hzwlsoft.com:1015' // 外网环境
// export let baseUrl = 'http://10.10.10.46:8055/' // 测试环境
// export const baseUrl = 'http://10.0.1.9:8080' // 本地环境
export const URL_CONFIG = '/jero-boot/'