|
|
@ -1,4 +1,5 @@ |
|
|
|
import Vue from 'vue' |
|
|
|
import Vue from 'vue' |
|
|
|
|
|
|
|
import { Loading } from 'element-ui' |
|
|
|
|
|
|
|
|
|
|
|
Vue.prototype.GLOBAL ={ |
|
|
|
Vue.prototype.GLOBAL ={ |
|
|
|
//用户cookie
|
|
|
|
//用户cookie
|
|
|
@ -14,6 +15,7 @@ Vue.prototype.GLOBAL ={ |
|
|
|
return !(r.top > z.bottom || r.bottom < z.top || |
|
|
|
return !(r.top > z.bottom || r.bottom < z.top || |
|
|
|
r.left > z.right || r.right < z.left); |
|
|
|
r.left > z.right || r.right < z.left); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//发送json请求
|
|
|
|
fetchJSON(url,method, form, success){ |
|
|
|
fetchJSON(url,method, form, success){ |
|
|
|
fetch(this.server_address + url, { |
|
|
|
fetch(this.server_address + url, { |
|
|
|
body:JSON.stringify(form), |
|
|
|
body:JSON.stringify(form), |
|
|
@ -26,6 +28,7 @@ Vue.prototype.GLOBAL ={ |
|
|
|
console.error(err) |
|
|
|
console.error(err) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//发送get请求
|
|
|
|
fetchGet(url,params,success){ |
|
|
|
fetchGet(url,params,success){ |
|
|
|
if (params) { |
|
|
|
if (params) { |
|
|
|
let paramsArray = []; |
|
|
|
let paramsArray = []; |
|
|
@ -43,6 +46,28 @@ Vue.prototype.GLOBAL ={ |
|
|
|
}).then(res=>res.json()).then(res=>success(res)).catch(err=>{ |
|
|
|
}).then(res=>res.json()).then(res=>success(res)).catch(err=>{ |
|
|
|
console.error(err) |
|
|
|
console.error(err) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//阅读论文
|
|
|
|
|
|
|
|
Vue.prototype.$read= function(item) { |
|
|
|
|
|
|
|
let loadingInstance =Loading.service({}); |
|
|
|
|
|
|
|
let that=this |
|
|
|
|
|
|
|
this.GLOBAL.fetchGet("/v1/api/file/find",{ |
|
|
|
|
|
|
|
paperId:item.id, |
|
|
|
|
|
|
|
fileId:item.fileId |
|
|
|
|
|
|
|
},function(res) { |
|
|
|
|
|
|
|
if(res.code==='200'){ |
|
|
|
|
|
|
|
item.content=res.msg |
|
|
|
|
|
|
|
that.$store.commit('menus/read') |
|
|
|
|
|
|
|
that.$store.commit('read/open', item) |
|
|
|
|
|
|
|
that.$router.push(that.localePath('/read')) |
|
|
|
|
|
|
|
loadingInstance.close() |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
loadingInstance.close() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|