fix:安全溯源bug

Signed-off-by: default avatarDESKTOP-RL2O6OD\没有姓名的打工人 <1601745371@qq.com>
parent 2c92d046
/**
* @desc 事件通讯
*/
class EventBus {
constructor(arg) {
this.events = {}
}
/**
* @desc 事件监听
*/
$on(key, fn) {
if(!this.events[key]) {
this.events[key] = []
}
this.events.push(fn)
}
/**
* @desc 事件派发
*/
$emit() {
const key = Array.prototype.splice.call(arguments)
const curE = this.events[key]
curE.apply(this, arguments)
}
/**
* @desc 取消事件监听
*/
$off(key) {
const events = this.events
for(let i = 0, j = events.length; i++) {
if(events[key]) { // 移除事件的监听
this.events.splice(i, 1)
}
}
}
}
export default EventBus
\ No newline at end of file
......@@ -109,15 +109,6 @@ export function request (options) {
uni.showLoading({title: '加载中...', mask: true})
}
return new Promise((resolve, reject) => {
// const isOverdue = store.state.user.isOverdue
// if(isOverdue) {
// reject({
// status: false,
// data: null,
// msg: '服务已过期'
// })
// return
// }
const token = store.state.user.token || ''
const appid = store.state.user.appid || ''
uni.request({
......@@ -147,60 +138,12 @@ export function request (options) {
})
}
// 请求
// export function testrequest (options) {
// const valite_err = validateOps(options)
// if(valite_err) return Toast({title: valite_err})
// options.method = options.method ? options.method.toUpperCase() : "GET" // 默认get
// options.url = `${options.url}`
// if(options.needMask) {
// uni.showLoading({title: '加载中...', mask: true})
// }
// return new Promise((resolve, reject) => {
// const token = store.state.user.token || ''
// const appid = store.state.user.appid || ''
// uni.request({
// ...options,
// header: {
// 'content-type': 'application/x-www-form-urlencoded',
// 'token': token,
// 'appid': appid
// },
// success: res => {
// successRes(res, options, resolve, reject)
// },
// fail: err => {
// Toast({title: '网络开小差了,请检查网络!'})
// options.errCb && typeof options.errCb === 'function' && options.errCb();
// reject({
// status: false,
// code: 400,
// data: err
// })
// },
// complete: () => {
// options.completeCb && typeof options.completeCb === 'function' && options.completeCb();
// options.needMask && uni.hideLoading()
// }
// })
// })
// }
// 上传文件
export function upload(options) {
const valite_err = validateOps(options)
if(valite_err) return Toast({title: valite_err})
uni.showLoading({title: '上传中...', mask: true})
return new Promise((resolve, reject) => {
// const isOverdue = store.state.user.isOverdue
// if(isOverdue) {
// reject({
// status: false,
// data: null,
// msg: '服务已过期'
// })
// return
// }
const token = store.state.user.token || ''
const appid = store.state.user.appid || ''
uni.uploadFile({
......
......@@ -249,9 +249,6 @@ export default {
data.order.countdownT = 0
// item.last_payTime = ''
}
data.goods.map(i => {
console.log(typeof i.batch_id, i.batch_id, ~~i.batch_id, !~~i.batch_id )
})
this.order_detail = {
goods: data.goods,
order: data.order || {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment