Kaynağa Gözat

update

master
unknown 4 yıl önce
ebeveyn
işleme
e61d035360
3 değiştirilmiş dosya ile 688 ekleme ve 478 silme
  1. +11
    -1
      src/services/template.js
  2. +9
    -6
      src/utils/request.js
  3. +668
    -471
      src/views/manage_system/template/index.vue

+ 11
- 1
src/services/template.js Dosyayı Görüntüle

@@ -1,4 +1,4 @@
import { fetchApi } from '@/utils/request';
import { fetchApi, wrapErrorHint } from '@/utils/request';
import { firstCharToLowerCase, firstCharToUpperCase } from '@/utils/tool';

export async function createTemplate(params) {
@@ -15,4 +15,14 @@ export async function uploadXmind(file) {
return await fetchApi('template/uploadingXmind', file, { headers: {
'Content-Type': 'application/octet-stream',
} });
}

export async function queryTemplateById(templateId) {
const res = await fetchApi('template/queryTemplateByTemplateId', { id: templateId });
return wrapErrorHint(res);
}

export async function updateTemplate(params) {
const res = await fetchApi('template/updateTemplate', params);
return wrapErrorHint(res);
}

+ 9
- 6
src/utils/request.js Dosyayı Görüntüle

@@ -1,6 +1,7 @@
import axios from 'axios';
import Vue from 'vue';
import router from '../router';
import { notify } from '@/utils/tool';

axios.defaults.withCredentials = true

@@ -32,12 +33,7 @@ axios.interceptors.response.use(
switch (error.response.status) {
case 401:
if (router.currentRoute.fullPath != '/') {
Vue.prototype.$notify.error({
title: "温馨提示",
message: '登录超时,请重新登录',
offset: 100,
duration: 5000,
});
notify.error('登录超时,请重新登录');
sessionStorage.clear();
router.push({ path: "/" });
}
@@ -60,6 +56,13 @@ export async function fetchApi(path, params, config) {
return res.data;
}

export function wrapErrorHint(response) {
if(response.Code !== 0) {
notify.error(response.Msg);
}
return response;
}

export default axios;

function mapApiPathToFullPath(path) {


+ 668
- 471
src/views/manage_system/template/index.vue
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


Yükleniyor…
İptal
Kaydet