Commit 402c2847 by 李金轩

ljx

1 parent f6b11234
.vscode
\ No newline at end of file
.vscode
.idea
\ No newline at end of file
git status
git add *
git commit -m %1%
git pull
git push
git status
\ No newline at end of file
This diff could not be displayed because it is too large.
const API = {
Login: '/users/login',
Accounts: '/accounts',
Malls: '/malls',
Gates: '/gates',
Devices: '/devices',
Channels: '/channels',
Mall: '/mall/',
FaceRecognitionsCount: '/faceRecognitions/count',
SimulationFaceRecognition: '/simulation/faceRecognition',
SimulationCountData: '/simulation/countData',
PreviewCountData: '/preview/countData',
mallStaffFeature: '/mall/staffFeature',
MallFeature: '/mall/feature',
MallStaffPool: '/mall/staffPool',
MallCustomPool: '/mall/customPool',
MallStaff: '/mall/staff',
MallCustom: '/mall/custom'
Login: '/users/login',
Accounts: '/accounts',
Malls: '/malls',
Gates: '/gates',
Devices: '/devices',
Channels: '/channels',
Mall: '/mall/',
FaceRecognitionsCount: '/faceRecognitions/count',
SimulationFaceRecognition: '/simulation/faceRecognition',
SimulationCountData: '/simulation/countData',
PreviewCountData: '/preview/countData',
mallStaffFeature: '/mall/staffFeature',
MallFeature: '/mall/feature',
MallStaffPool: '/mall/staffPool',
MallCustomPool: '/mall/customPool',
MallStaff: '/mall/staff',
MallCustom: '/mall/custom'
}
const WSAPI = {
RecalSchedule: '/recal/schedule/'
RecalSchedule: '/recal/schedule/'
}
window._serverHost = window.location.hostname === 'localhost' ? 'store.keliuyun.com:9998' : window.location.host
window._baseUrl = `http://${window._serverHost}`
window._CONF_ = {
reportApiUrl: '',
apiUrl: '',
webSockUrl: ''
reportApiUrl: '',
apiUrl: window._baseUrl,
webSockUrl: ''
}
const log = console.log.bind(console)
const Axios = axios.create({
baseURL: window._CONF_.apiUrl,
timeout: 0,
withCredentials: true,
headers: {
"Content-Type": "application/json;charset=UTF-8"
}
baseURL: window._CONF_.apiUrl,
timeout: 0,
withCredentials: true,
headers: {
"Content-Type": "application/json;charset=UTF-8"
}
})
Axios.interceptors.request.use(
config => {
// const atoken = Cookies.get('atoken')
// console.log('atoken', atoken)
// atoken && (config.headers.Authorization = atoken)
return config
},
error => {
return Promise.reject(error)
}
config => {
// const atoken = Cookies.get('atoken')
// console.log('atoken', atoken)
// atoken && (config.headers.Authorization = atoken)
return config
},
error => {
return Promise.reject(error)
}
)
Axios.interceptors.response.use(
res => {
// if (res.data.enote || res.data.code === 401) {
// ELEMENT.MessageBox.alert('授权到期, 请重新登录', '提示', {
// confirmButtonText: '确定',
// callback: action => {
// console.log('action', action)
// window.location.replace(window.location.href + 'login.html')
// }
// });
// } else {
return Promise.resolve(res.data)
// }
},
error => {
console.error(error)
return Promise.reject(error)
}
res => {
// if (res.data.enote || res.data.code === 401) {
// ELEMENT.MessageBox.alert('授权到期, 请重新登录', '提示', {
// confirmButtonText: '确定',
// callback: action => {
// console.log('action', action)
// window.location.replace(window.location.href + 'login.html')
// }
// });
// } else {
return Promise.resolve(res.data)
// }
},
error => {
console.error(error)
return Promise.reject(error)
}
)
function get(url, params = {}, config = {}) {
params['s'] = +new Date()
return Axios.get(url, { ...config, params })
params['s'] = +new Date()
return Axios.get(url, {...config, params})
}
function post(url, params, config = {}) {
return Axios.post(url, params, config)
return Axios.post(url, params, config)
}
function deletes(url, params, config = {}) {
return Axios.delete(url, params, config)
return Axios.delete(url, params, config)
}
function put(url, params, config = {}) {
return Axios.put(url, params, config)
return Axios.put(url, params, config)
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!