Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.use(config => {
// 统一对中文字符进行编码
config.url = encodeURI(config.url)
/**
* 如果是登陆请求,不发送token
* 否则都带token过去
*/
config.url.indexOf('login') != -1
? config.headers.Authorization = ""
: config.headers.Authorization = `Bearer ${storage.getMemoryPmt('token')}`
loading = Loading.service({ fullscreen: true, background: "rgba(255, 255, 255, .4)", customClass: 'top-floor' })
return config
}, err => {
Message.errorMsg('服务器出错,请联系客服进行处理')
const { locale } = config
const localeManager = getLocaleManager()
localeManager.changeLanguageByLocale(locale)
Vue.use(VueI18Next)
const i18n = new VueI18Next(localeManager.getI18n())
Vue.use(Element, {
size: 'mini',
i18n: (key, value) => i18n.t(key, value)
})
Vue.use(Msg, Message, {
showClose: true
})
const loading = Loading.service({
fullscreen: true,
background: 'rgba(0, 0, 0, 0.1)'
})
Vue.component('mo-icon', Icon)
sync(store, router)
/* eslint-disable no-new */
window.app = new Vue({
components: { App },
router,
store,
i18n,
template: ''
}).$mount('#app')
created() {
this.dialogVisible = this.photoVisible;
this.form.photoList = this.photos;
this.form.fileIds = this.files;
let loadingInstance = Loading.service({
target: "#body-loading",
text: "加载中~"
});
//加载数据
var that = this;
let index = 0;
//先加载分类
if (!that.havePictureSorts) {
var params = new URLSearchParams();
// TODO 全部把分类加载出来,如果图片很多的话,不能这么做
params.append("pageSize", "500");
getPictureSortList(params).then(function(response) {
if (response.code == "success") {
var pictureSorts = response.data.records;
that.pictureSorts = pictureSorts;
taglist(){
this.$store.commit('updatetaglistcon',[])
console.log(this.$store.state.taglistcon)
this.fadetitle= false;
let loadingInstance=Loading.service();
let tag = this.$route.params.tag
console.log("奥斯卡撒昆明大上课没打算考虑的马萨看到了吗")
this.$http.get('/api/getArticleLabel/'+tag).then(
res => {
if(res.body.length<10){
this.scrollbottomtipno=true;
}
this.tagList = res.body;
this.tagtitle=this.$store.state.tagtitle
loadingInstance.close();
this.lastpage=true;
this.ScrollFirst=true;
this.fadetitle= true
function loadingRequestInterceptor(config) {
if (!loading) {
loading = Loading.service({
target: 'body',
background: 'transparent',
text: '载入中',
})
store.commit(SET_AXIOS_LOADING, true)
}
loadingCount++
return config
}
handleBeforeUpload() {
this.loadingInstance = Loading.service({
lock: true,
text: this.$t('common.uploading'),
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
},
handleUploadSuccess(response, raw) {
show(options) {
if (!this.unique) {
var opt = Object.assign({customClass: 'global-mask', target: '.main-page'}, options);
this.unique = Loading.service(opt);
}
},
showMask() {
before: config => {
if (loadingInstance === null) {
loadingInstance = Loading.service({ target: "#main", fullscreen: false });
}
return config;
},
error: error => {