create-meadminjs 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +0 -0
- package/bin/index.js +0 -0
- package/dist/cli.js +0 -1
- package/package.json +36 -38
- package/template/meadmin/packageTemplate.json +2 -2
- package/template/meadmin/src/logger.ts +24 -24
- package/template/meadmin/src/types/mwtsc.d.ts +9 -0
- package/template/meadmin/tsconfig.json +1 -1
- package/template/meadmin/view/index/dist/assets/404-B7Oawy5R.js +1 -0
- package/template/meadmin/view/index/dist/assets/404-B7Oawy5R.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/404-B7Oawy5R.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/404-CozhfxlA.css +1 -0
- package/template/meadmin/view/index/dist/assets/404-CozhfxlA.css.br +0 -0
- package/template/meadmin/view/index/dist/assets/404-CozhfxlA.css.gz +0 -0
- package/template/meadmin/view/index/dist/assets/404-DSkhiBHr.svg +339 -0
- package/template/meadmin/view/index/dist/assets/404-DSkhiBHr.svg.br +0 -0
- package/template/meadmin/view/index/dist/assets/404-DSkhiBHr.svg.gz +0 -0
- package/template/meadmin/view/index/dist/assets/avatar-CPvykNE-.jpg +0 -0
- package/template/meadmin/view/index/dist/assets/core-CY5zzX7u.css +1 -0
- package/template/meadmin/view/index/dist/assets/core-CY5zzX7u.css.br +0 -0
- package/template/meadmin/view/index/dist/assets/core-CY5zzX7u.css.gz +0 -0
- package/template/meadmin/view/index/dist/assets/core-DYgtGCsy.js +36 -0
- package/template/meadmin/view/index/dist/assets/core-DYgtGCsy.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/core-DYgtGCsy.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/iconfont.1764811574696-C-d53NQO.woff +0 -0
- package/template/meadmin/view/index/dist/assets/iconfont.1764811574696-C396vfjy.ttf +0 -0
- package/template/meadmin/view/index/dist/assets/iconfont.1764834414498-BllfKX1O.ttf +0 -0
- package/template/meadmin/view/index/dist/assets/iconfont.1764834414498-D9epzWxu.woff +0 -0
- package/template/meadmin/view/index/dist/assets/index-B3PE5HQn.css +1 -0
- package/template/meadmin/view/index/dist/assets/index-B3PE5HQn.css.br +0 -0
- package/template/meadmin/view/index/dist/assets/index-B3PE5HQn.css.gz +0 -0
- package/template/meadmin/view/index/dist/assets/index-B3e7_EsO.css +1 -0
- package/template/meadmin/view/index/dist/assets/index-B3e7_EsO.css.br +0 -0
- package/template/meadmin/view/index/dist/assets/index-B3e7_EsO.css.gz +0 -0
- package/template/meadmin/view/index/dist/assets/index-BzGDrXWK.js +1 -0
- package/template/meadmin/view/index/dist/assets/index-BzGDrXWK.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/index-BzGDrXWK.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/index-D6Bdjbmj.css +1 -0
- package/template/meadmin/view/index/dist/assets/index-D6Bdjbmj.css.br +0 -0
- package/template/meadmin/view/index/dist/assets/index-D6Bdjbmj.css.gz +0 -0
- package/template/meadmin/view/index/dist/assets/index-Dk1Rpy73.js +1 -0
- package/template/meadmin/view/index/dist/assets/index-Dk1Rpy73.js.br +2 -0
- package/template/meadmin/view/index/dist/assets/index-Dk1Rpy73.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/index-Dt87n6GJ.css +1 -0
- package/template/meadmin/view/index/dist/assets/index-Dt87n6GJ.css.br +0 -0
- package/template/meadmin/view/index/dist/assets/index-Dt87n6GJ.css.gz +0 -0
- package/template/meadmin/view/index/dist/assets/index-DzU3RK7y.js +1 -0
- package/template/meadmin/view/index/dist/assets/index-DzU3RK7y.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/index-DzU3RK7y.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/index-eAIKfPTe.js +8 -0
- package/template/meadmin/view/index/dist/assets/index-eAIKfPTe.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/index-eAIKfPTe.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/meButton.vue_vue_type_script_setup_true_name_MeButton_lang-Chv--Mwp.js +1 -0
- package/template/meadmin/view/index/dist/assets/meButton.vue_vue_type_script_setup_true_name_MeButton_lang-Chv--Mwp.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/meButton.vue_vue_type_script_setup_true_name_MeButton_lang-Chv--Mwp.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/meUpAvatar-CwQ1B8_T.js +1 -0
- package/template/meadmin/view/index/dist/assets/meUpAvatar-CwQ1B8_T.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/meUpAvatar-CwQ1B8_T.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/meUpAvatar-VeMBR6Vn.css +1 -0
- package/template/meadmin/view/index/dist/assets/meUpAvatar-VeMBR6Vn.css.br +0 -0
- package/template/meadmin/view/index/dist/assets/meUpAvatar-VeMBR6Vn.css.gz +0 -0
- package/template/meadmin/view/index/dist/assets/promiseError-2WriTuHu.css +1 -0
- package/template/meadmin/view/index/dist/assets/promiseError-2WriTuHu.css.br +0 -0
- package/template/meadmin/view/index/dist/assets/promiseError-2WriTuHu.css.gz +0 -0
- package/template/meadmin/view/index/dist/assets/promiseError-DE4bj2f8.js +1 -0
- package/template/meadmin/view/index/dist/assets/promiseError-DE4bj2f8.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/promiseError-DE4bj2f8.js.gz +0 -0
- package/template/meadmin/view/index/dist/assets/redirect-BvCSNyBL.js +1 -0
- package/template/meadmin/view/index/dist/assets/redirect-BvCSNyBL.js.br +0 -0
- package/template/meadmin/view/index/dist/assets/redirect-BvCSNyBL.js.gz +0 -0
- package/template/meadmin/view/index/dist/favicon.ico +0 -0
- package/template/meadmin/view/index/dist/index.html +25 -0
- package/template/meadmin/view/index/dist/index.html.br +0 -0
- package/template/meadmin/view/index/dist/index.html.gz +0 -0
- package/template/meadmin/view/index/dist/logo.png +0 -0
- package/template/meadmin/view/index/dist/logo.svg +1 -0
- package/template/meadmin/view/index/dist/logo.svg.br +0 -0
- package/template/meadmin/view/index/dist/logo.svg.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/404-B9UJ1mUk.js +71 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/404-B9UJ1mUk.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/404-B9UJ1mUk.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-DLA-WCC9.js +141 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-DLA-WCC9.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-DLA-WCC9.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-Dp0aaFR-.js +863 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-Dp0aaFR-.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-Dp0aaFR-.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-jfc9wRUh.js +712 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-jfc9wRUh.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/index-jfc9wRUh.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/meButton-C6nJLVaV.js +63 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/meButton-C6nJLVaV.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/meButton-C6nJLVaV.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/meUpAvatar-BitBSZhv.js +272 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/meUpAvatar-BitBSZhv.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/meUpAvatar-BitBSZhv.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/promiseError-htSuzmaR.js +106 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/promiseError-htSuzmaR.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/promiseError-htSuzmaR.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/redirect-D73DvP_s.js +65 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/redirect-D73DvP_s.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/assets/redirect-D73DvP_s.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr/src/entry-server.js +1918 -0
- package/template/meadmin/view/index/dist/ssr/src/entry-server.js.br +0 -0
- package/template/meadmin/view/index/dist/ssr/src/entry-server.js.gz +0 -0
- package/template/meadmin/view/index/dist/ssr-manifest.json +16989 -0
- package/template/meadmin/view/index/types/components.d.ts +2 -2
- package/template/meadmin/src/middleware/report.middleware.ts +0 -23
- package/template/meadmin/types/mwtsc.d.ts +0 -9
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import "../entry-server.js";
|
|
2
|
+
import { ElButton } from "element-plus/es";
|
|
3
|
+
import { defineComponent, ref, useAttrs, getCurrentInstance, mergeProps, unref, createSlots, renderList, withCtx, renderSlot, useSSRContext } from "vue";
|
|
4
|
+
import { ssrRenderComponent, ssrRenderSlot } from "vue/server-renderer";
|
|
5
|
+
import { omit } from "lodash-es";
|
|
6
|
+
const __default__ = defineComponent({ "setup": true, "name": "MeButton" });
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...__default__,
|
|
9
|
+
...{ inheritAttrs: false },
|
|
10
|
+
__name: "meButton",
|
|
11
|
+
__ssrInlineRender: true,
|
|
12
|
+
setup(__props, { expose: __expose }) {
|
|
13
|
+
const loading = ref(false);
|
|
14
|
+
const attrs = useAttrs();
|
|
15
|
+
async function handleClick(event) {
|
|
16
|
+
loading.value = true;
|
|
17
|
+
try {
|
|
18
|
+
await attrs.onClick?.(event);
|
|
19
|
+
} finally {
|
|
20
|
+
loading.value = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const vm = getCurrentInstance();
|
|
24
|
+
function changeRef(ref2) {
|
|
25
|
+
if (vm) {
|
|
26
|
+
vm.exposed = ref2;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
__expose({});
|
|
30
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
31
|
+
const _component_el_button = ElButton;
|
|
32
|
+
_push(ssrRenderComponent(_component_el_button, mergeProps(unref(omit)(unref(attrs), "onClick", "loading"), {
|
|
33
|
+
ref: changeRef,
|
|
34
|
+
loading: unref(loading),
|
|
35
|
+
onClick: handleClick
|
|
36
|
+
}, _attrs), createSlots({ _: 2 }, [
|
|
37
|
+
renderList(_ctx.$slots, (_, name) => {
|
|
38
|
+
return {
|
|
39
|
+
name,
|
|
40
|
+
fn: withCtx((data, _push2, _parent2, _scopeId) => {
|
|
41
|
+
if (_push2) {
|
|
42
|
+
ssrRenderSlot(_ctx.$slots, name, data || {}, null, _push2, _parent2, _scopeId);
|
|
43
|
+
} else {
|
|
44
|
+
return [
|
|
45
|
+
renderSlot(_ctx.$slots, name, data || {})
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
};
|
|
50
|
+
})
|
|
51
|
+
]), _parent));
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const _sfc_setup = _sfc_main.setup;
|
|
56
|
+
_sfc_main.setup = (props, ctx) => {
|
|
57
|
+
const ssrContext = useSSRContext();
|
|
58
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/meButton.vue");
|
|
59
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
_sfc_main as _
|
|
63
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { b as request, _ as __ssr_vue_processAssetPath, a as _export_sfc } from "../entry-server.js";
|
|
2
|
+
import { ElUpload, ElMessage } from "element-plus/es";
|
|
3
|
+
import { createVNode, render, defineComponent, useModel, reactive, watch, ref, computed, resolveComponent, unref, mergeProps, isRef, withCtx, createBlock, createCommentVNode, openBlock, Fragment, useSSRContext } from "vue";
|
|
4
|
+
import { ssrRenderComponent } from "vue/server-renderer";
|
|
5
|
+
import "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
+
import "core-js/modules/es.error.cause.js";
|
|
7
|
+
import "core-js/modules/es.array.push.js";
|
|
8
|
+
import "core-js/modules/es.iterator.constructor.js";
|
|
9
|
+
import "core-js/modules/es.iterator.for-each.js";
|
|
10
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
11
|
+
import SparkMD5 from "spark-md5";
|
|
12
|
+
import { ElImageViewer } from "element-plus";
|
|
13
|
+
function uploadFileApi(returnAxios = true) {
|
|
14
|
+
return request((data) => ({
|
|
15
|
+
url: "file/upload",
|
|
16
|
+
method: "post",
|
|
17
|
+
data,
|
|
18
|
+
headers: {
|
|
19
|
+
"Content-Type": "multipart/form-data"
|
|
20
|
+
}
|
|
21
|
+
}), {
|
|
22
|
+
success: false,
|
|
23
|
+
noLoading: true
|
|
24
|
+
}, returnAxios);
|
|
25
|
+
}
|
|
26
|
+
let md5Worker;
|
|
27
|
+
const getMd5 = (file, chunkSize = 1024 * 1024, progress) => new Promise((resolve, reject) => {
|
|
28
|
+
const workHandler = (e) => {
|
|
29
|
+
const data = e.data;
|
|
30
|
+
if (data.uid !== file.uid) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (data.status === "success") {
|
|
34
|
+
md5Worker.removeEventListener("message", workHandler);
|
|
35
|
+
resolve(data.md5);
|
|
36
|
+
} else if (data.status === "progress") {
|
|
37
|
+
progress === null || progress === void 0 || progress(data.percent);
|
|
38
|
+
} else if (data.status === "failed") {
|
|
39
|
+
md5Worker.removeEventListener("message", workHandler);
|
|
40
|
+
reject(data.error);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
md5Worker.addEventListener("message", workHandler);
|
|
44
|
+
md5Worker.postMessage({
|
|
45
|
+
file,
|
|
46
|
+
chunkSize,
|
|
47
|
+
uid: file.uid
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
const uploadChunksExecute = (file, currentChunk, chunkSize, data = {}) => new Promise((resolve, reject) => {
|
|
51
|
+
try {
|
|
52
|
+
const start = currentChunk * chunkSize;
|
|
53
|
+
const end = start + chunkSize >= file.size ? file.size : start + chunkSize;
|
|
54
|
+
const fileReader = new FileReader();
|
|
55
|
+
fileReader.onload = async (e) => {
|
|
56
|
+
try {
|
|
57
|
+
const formData = new FormData();
|
|
58
|
+
const upFile = new File([e.target.result || ""], file.name, {
|
|
59
|
+
type: file.type
|
|
60
|
+
});
|
|
61
|
+
data.start = start + "";
|
|
62
|
+
data.chunkMd5 = SparkMD5.ArrayBuffer.hash(e.target.result);
|
|
63
|
+
Object.keys(data).forEach((key) => {
|
|
64
|
+
formData.append(key, Array.isArray(data[key]) ? String(data[key]) : data[key]);
|
|
65
|
+
});
|
|
66
|
+
formData.append("file", upFile);
|
|
67
|
+
return resolve(await uploadFileApi()(formData));
|
|
68
|
+
} catch (e2) {
|
|
69
|
+
reject(e2);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
fileReader.onerror = (error) => {
|
|
73
|
+
reject(error);
|
|
74
|
+
};
|
|
75
|
+
fileReader.readAsArrayBuffer(File.prototype.slice.call(file, start, end));
|
|
76
|
+
} catch (e) {
|
|
77
|
+
reject(e);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const uploadChunks = (file, chunkSize, data = {}, progress) => new Promise(async (resolve, reject) => {
|
|
81
|
+
try {
|
|
82
|
+
let currentChunk = 0;
|
|
83
|
+
const chunks = Math.ceil(file.size / chunkSize);
|
|
84
|
+
if (chunks > 1) {
|
|
85
|
+
const res2 = await uploadChunksExecute(file, currentChunk, chunkSize, Object.assign(data, {
|
|
86
|
+
chunkIndex: currentChunk + "",
|
|
87
|
+
over: "0"
|
|
88
|
+
}));
|
|
89
|
+
if (res2.id) {
|
|
90
|
+
progress === null || progress === void 0 || progress("100");
|
|
91
|
+
return resolve(res2);
|
|
92
|
+
}
|
|
93
|
+
currentChunk++;
|
|
94
|
+
progress === null || progress === void 0 || progress((currentChunk / chunks * 100).toFixed(2));
|
|
95
|
+
const parallelNum = 3;
|
|
96
|
+
for (; currentChunk < chunks - 1; ) {
|
|
97
|
+
const promiseArr = [];
|
|
98
|
+
for (let i = 0; i < parallelNum; i++) {
|
|
99
|
+
if (currentChunk < chunks - 1) {
|
|
100
|
+
promiseArr.push(uploadChunksExecute(file, currentChunk, chunkSize, Object.assign(data, {
|
|
101
|
+
chunkIndex: currentChunk + "",
|
|
102
|
+
over: "0"
|
|
103
|
+
})));
|
|
104
|
+
currentChunk++;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
await Promise.all(promiseArr);
|
|
108
|
+
progress === null || progress === void 0 || progress((currentChunk / chunks * 100).toFixed(2));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const res = await uploadChunksExecute(file, currentChunk, chunkSize, Object.assign(data, {
|
|
112
|
+
chunkIndex: currentChunk + "",
|
|
113
|
+
over: "1"
|
|
114
|
+
}));
|
|
115
|
+
progress === null || progress === void 0 || progress("100");
|
|
116
|
+
return resolve(res);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
reject(e);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const fileUpload = async (options) => {
|
|
122
|
+
const chunkSize = 1024 * 1024;
|
|
123
|
+
const progressEvt = new ProgressEvent("uploadProgress", {
|
|
124
|
+
lengthComputable: true,
|
|
125
|
+
loaded: 0,
|
|
126
|
+
total: 100
|
|
127
|
+
});
|
|
128
|
+
progressEvt.percent = 0;
|
|
129
|
+
options.data.md5 = await getMd5(options.file, chunkSize, (process) => {
|
|
130
|
+
progressEvt.percent = +process * 5 / 100;
|
|
131
|
+
options.onProgress(progressEvt);
|
|
132
|
+
});
|
|
133
|
+
options.data.chunk = "1";
|
|
134
|
+
options.data.name = options.file.name;
|
|
135
|
+
const res = await uploadChunks(options.file, chunkSize, options.data, (process) => {
|
|
136
|
+
progressEvt.percent = +process * 95 / 100 + 5;
|
|
137
|
+
options.onProgress(progressEvt);
|
|
138
|
+
});
|
|
139
|
+
return res;
|
|
140
|
+
};
|
|
141
|
+
function createImageViewer(props) {
|
|
142
|
+
const vnode = createVNode(ElImageViewer, Object.assign({
|
|
143
|
+
// 解决 element plus 2.8.0 及以上版本,不能关闭 image-viewer 的问题
|
|
144
|
+
teleported: true,
|
|
145
|
+
onClose: function() {
|
|
146
|
+
render(null, document.body);
|
|
147
|
+
if (typeof props.onClose === "function") {
|
|
148
|
+
props.onClose.call(this);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, props));
|
|
152
|
+
render(vnode, document.body);
|
|
153
|
+
return vnode;
|
|
154
|
+
}
|
|
155
|
+
const __default__ = defineComponent({ "setup": true, "name": "MeUpAvatar" });
|
|
156
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
157
|
+
...__default__,
|
|
158
|
+
__name: "meUpAvatar",
|
|
159
|
+
__ssrInlineRender: true,
|
|
160
|
+
props: {
|
|
161
|
+
"modelValue": void 0,
|
|
162
|
+
"modelModifiers": {}
|
|
163
|
+
},
|
|
164
|
+
emits: ["update:modelValue"],
|
|
165
|
+
setup(__props) {
|
|
166
|
+
const file = useModel(__props, "modelValue", void 0);
|
|
167
|
+
const fileList = reactive([]);
|
|
168
|
+
watch(
|
|
169
|
+
() => file.value,
|
|
170
|
+
(file2) => {
|
|
171
|
+
fileList.splice(0);
|
|
172
|
+
file2 && fileList.push(file2);
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
const handlePictureCardPreview = () => {
|
|
176
|
+
file.value && createImageViewer({
|
|
177
|
+
urlList: [file.value.url],
|
|
178
|
+
initialIndex: 0,
|
|
179
|
+
showProgress: true
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
const handleHttpRequest = (options) => {
|
|
183
|
+
return fileUpload(options);
|
|
184
|
+
};
|
|
185
|
+
const handleSuccess = (response, uploadFile) => {
|
|
186
|
+
response.uid = uploadFile.uid;
|
|
187
|
+
file.value = response;
|
|
188
|
+
};
|
|
189
|
+
const handleRemove = () => {
|
|
190
|
+
file.value = void 0;
|
|
191
|
+
process.value = 0;
|
|
192
|
+
};
|
|
193
|
+
const beforeAvatarUpload = (rawFile) => {
|
|
194
|
+
if (!/image*/.test(rawFile.type)) {
|
|
195
|
+
ElMessage.error("必须是正确的图片文件");
|
|
196
|
+
return false;
|
|
197
|
+
} else if (rawFile.size / 1024 / 1024 > 2) {
|
|
198
|
+
ElMessage.error("图片大小不能超过 2MB!");
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
return true;
|
|
202
|
+
};
|
|
203
|
+
const handleExceed = () => {
|
|
204
|
+
ElMessage({ type: "error", message: `最多上传1个文件` });
|
|
205
|
+
};
|
|
206
|
+
const process = ref(0);
|
|
207
|
+
const processDeg = computed(() => {
|
|
208
|
+
return process.value / 100 * 360 + "deg";
|
|
209
|
+
});
|
|
210
|
+
const setProcess = (env) => {
|
|
211
|
+
process.value = env.percent;
|
|
212
|
+
};
|
|
213
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
214
|
+
const _component_el_upload = ElUpload;
|
|
215
|
+
const _component_mel_icon_upload_filled = resolveComponent("mel-icon-upload-filled");
|
|
216
|
+
const _cssVars = { style: {
|
|
217
|
+
":--a9d345b2": unref(processDeg)
|
|
218
|
+
} };
|
|
219
|
+
_push(ssrRenderComponent(_component_el_upload, mergeProps({
|
|
220
|
+
"file-list": unref(fileList),
|
|
221
|
+
"onUpdate:fileList": ($event) => isRef(fileList) ? fileList.value = $event : null,
|
|
222
|
+
"list-type": "picture-card",
|
|
223
|
+
accept: "image/*",
|
|
224
|
+
class: ["me-up-avater", { upload: unref(process) > 0 }],
|
|
225
|
+
limit: 1,
|
|
226
|
+
"http-request": handleHttpRequest,
|
|
227
|
+
"before-upload": beforeAvatarUpload,
|
|
228
|
+
onSuccess: handleSuccess,
|
|
229
|
+
onRemove: handleRemove,
|
|
230
|
+
onExceed: handleExceed,
|
|
231
|
+
onPreview: handlePictureCardPreview,
|
|
232
|
+
onProgress: setProcess
|
|
233
|
+
}, _attrs, _cssVars), {
|
|
234
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
235
|
+
if (_push2) {
|
|
236
|
+
if (!file.value) {
|
|
237
|
+
_push2(`<!--[-->`);
|
|
238
|
+
_push2(ssrRenderComponent(_component_mel_icon_upload_filled, { class: "default-up-icon" }, null, _parent2, _scopeId));
|
|
239
|
+
_push2(`<div class="text" data-v-83bbb0f7${_scopeId}>`);
|
|
240
|
+
_push2(ssrRenderComponent(_component_mel_icon_upload_filled, null, null, _parent2, _scopeId));
|
|
241
|
+
_push2(`<div class="text-desc" data-v-83bbb0f7${_scopeId}>上传头像</div></div><!--]-->`);
|
|
242
|
+
} else {
|
|
243
|
+
_push2(`<!---->`);
|
|
244
|
+
}
|
|
245
|
+
} else {
|
|
246
|
+
return [
|
|
247
|
+
!file.value ? (openBlock(), createBlock(Fragment, { key: 0 }, [
|
|
248
|
+
createVNode(_component_mel_icon_upload_filled, { class: "default-up-icon" }),
|
|
249
|
+
createVNode("div", { class: "text" }, [
|
|
250
|
+
createVNode(_component_mel_icon_upload_filled),
|
|
251
|
+
createVNode("div", { class: "text-desc" }, "上传头像")
|
|
252
|
+
])
|
|
253
|
+
], 64)) : createCommentVNode("", true)
|
|
254
|
+
];
|
|
255
|
+
}
|
|
256
|
+
}),
|
|
257
|
+
_: 1
|
|
258
|
+
}, _parent));
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
__ssr_vue_processAssetPath;
|
|
263
|
+
const _sfc_setup = _sfc_main.setup;
|
|
264
|
+
_sfc_main.setup = (props, ctx) => {
|
|
265
|
+
const ssrContext = useSSRContext();
|
|
266
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/meUpAvatar.vue");
|
|
267
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
268
|
+
};
|
|
269
|
+
const __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-83bbb0f7"]]);
|
|
270
|
+
export {
|
|
271
|
+
__unplugin_components_2 as _
|
|
272
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { u as useUserStore, _ as __ssr_vue_processAssetPath, a as _export_sfc } from "../entry-server.js";
|
|
2
|
+
import { _ as _sfc_main$1 } from "./meButton-C6nJLVaV.js";
|
|
3
|
+
import { defineComponent, resolveComponent, mergeProps, unref, withCtx, createTextVNode, toDisplayString, useSSRContext } from "vue";
|
|
4
|
+
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from "vue/server-renderer";
|
|
5
|
+
import { useRouter } from "vue-router";
|
|
6
|
+
import "core-js/modules/es.array.push.js";
|
|
7
|
+
import "core-js/modules/es.iterator.constructor.js";
|
|
8
|
+
import "core-js/modules/es.iterator.for-each.js";
|
|
9
|
+
import "core-js/modules/es.iterator.reduce.js";
|
|
10
|
+
import "core-js/modules/es.set.difference.v2.js";
|
|
11
|
+
import "core-js/modules/es.set.intersection.v2.js";
|
|
12
|
+
import "core-js/modules/es.set.is-disjoint-from.v2.js";
|
|
13
|
+
import "core-js/modules/es.set.is-subset-of.v2.js";
|
|
14
|
+
import "core-js/modules/es.set.is-superset-of.v2.js";
|
|
15
|
+
import "core-js/modules/es.set.symmetric-difference.v2.js";
|
|
16
|
+
import "core-js/modules/es.set.union.v2.js";
|
|
17
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
18
|
+
import "node:path";
|
|
19
|
+
import "serialize-javascript";
|
|
20
|
+
import "element-plus";
|
|
21
|
+
import "nprogress";
|
|
22
|
+
import "@element-plus/icons-vue";
|
|
23
|
+
import "lodash-es";
|
|
24
|
+
import "path-browserify";
|
|
25
|
+
import "core-js/modules/es.string.replace.js";
|
|
26
|
+
import "pinia";
|
|
27
|
+
import "dayjs";
|
|
28
|
+
import "element-plus/es";
|
|
29
|
+
import "core-js/modules/es.error.cause.js";
|
|
30
|
+
import "@babel/runtime/helpers/esm/defineProperty";
|
|
31
|
+
import "core-js/modules/es.json.stringify.js";
|
|
32
|
+
import "axios";
|
|
33
|
+
import "qs";
|
|
34
|
+
import "vue-request";
|
|
35
|
+
import "core-js/modules/es.array.includes.js";
|
|
36
|
+
import "core-js/modules/es.iterator.some.js";
|
|
37
|
+
import "core-js/modules/es.object.has-own.js";
|
|
38
|
+
import "xe-utils";
|
|
39
|
+
import "js-cookie";
|
|
40
|
+
import "vxe-pc-ui";
|
|
41
|
+
import "vxe-table";
|
|
42
|
+
import "vxe-table-plugin-element";
|
|
43
|
+
const __default__ = defineComponent({ "setup": true, "name": "PromiseError" });
|
|
44
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
45
|
+
...__default__,
|
|
46
|
+
__name: "promiseError",
|
|
47
|
+
__ssrInlineRender: true,
|
|
48
|
+
props: {
|
|
49
|
+
msg: {}
|
|
50
|
+
},
|
|
51
|
+
setup(__props) {
|
|
52
|
+
const userStore = useUserStore();
|
|
53
|
+
const router = useRouter();
|
|
54
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
55
|
+
const _component_mel_icon_warning_filled = resolveComponent("mel-icon-warning-filled");
|
|
56
|
+
const _component_me_button = _sfc_main$1;
|
|
57
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "promise-error" }, _attrs))} data-v-c5264885>`);
|
|
58
|
+
_push(ssrRenderComponent(_component_mel_icon_warning_filled, { class: "warn-icon" }, null, _parent));
|
|
59
|
+
_push(`<div class="title" data-v-c5264885>无权限访问</div><div class="footer" data-v-c5264885>`);
|
|
60
|
+
_push(ssrRenderComponent(_component_me_button, {
|
|
61
|
+
class: "button",
|
|
62
|
+
onClick: unref(router).back
|
|
63
|
+
}, {
|
|
64
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
65
|
+
if (_push2) {
|
|
66
|
+
_push2(`返回上一页`);
|
|
67
|
+
} else {
|
|
68
|
+
return [
|
|
69
|
+
createTextVNode("返回上一页")
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
_: 1
|
|
74
|
+
}, _parent));
|
|
75
|
+
_push(ssrRenderComponent(_component_me_button, {
|
|
76
|
+
class: "button active",
|
|
77
|
+
type: "primary",
|
|
78
|
+
plain: "",
|
|
79
|
+
onClick: unref(userStore).logOut
|
|
80
|
+
}, {
|
|
81
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
82
|
+
if (_push2) {
|
|
83
|
+
_push2(`${ssrInterpolate(unref(userStore).token ? "重新登陆" : "去 登 陆")}`);
|
|
84
|
+
} else {
|
|
85
|
+
return [
|
|
86
|
+
createTextVNode(toDisplayString(unref(userStore).token ? "重新登陆" : "去 登 陆"), 1)
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
}),
|
|
90
|
+
_: 1
|
|
91
|
+
}, _parent));
|
|
92
|
+
_push(`</div></div>`);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
__ssr_vue_processAssetPath;
|
|
97
|
+
const _sfc_setup = _sfc_main.setup;
|
|
98
|
+
_sfc_main.setup = (props, ctx) => {
|
|
99
|
+
const ssrContext = useSSRContext();
|
|
100
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/promiseError.vue");
|
|
101
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
102
|
+
};
|
|
103
|
+
const promiseError = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c5264885"]]);
|
|
104
|
+
export {
|
|
105
|
+
promiseError as default
|
|
106
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import "../entry-server.js";
|
|
2
|
+
import { defineComponent, onMounted, useSSRContext } from "vue";
|
|
3
|
+
import { ssrRenderAttrs } from "vue/server-renderer";
|
|
4
|
+
import { useRoute, useRouter } from "vue-router";
|
|
5
|
+
import "core-js/modules/es.array.push.js";
|
|
6
|
+
import "core-js/modules/es.iterator.constructor.js";
|
|
7
|
+
import "core-js/modules/es.iterator.for-each.js";
|
|
8
|
+
import "core-js/modules/es.iterator.reduce.js";
|
|
9
|
+
import "core-js/modules/es.set.difference.v2.js";
|
|
10
|
+
import "core-js/modules/es.set.intersection.v2.js";
|
|
11
|
+
import "core-js/modules/es.set.is-disjoint-from.v2.js";
|
|
12
|
+
import "core-js/modules/es.set.is-subset-of.v2.js";
|
|
13
|
+
import "core-js/modules/es.set.is-superset-of.v2.js";
|
|
14
|
+
import "core-js/modules/es.set.symmetric-difference.v2.js";
|
|
15
|
+
import "core-js/modules/es.set.union.v2.js";
|
|
16
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
17
|
+
import "node:path";
|
|
18
|
+
import "serialize-javascript";
|
|
19
|
+
import "element-plus";
|
|
20
|
+
import "nprogress";
|
|
21
|
+
import "@element-plus/icons-vue";
|
|
22
|
+
import "lodash-es";
|
|
23
|
+
import "path-browserify";
|
|
24
|
+
import "core-js/modules/es.string.replace.js";
|
|
25
|
+
import "pinia";
|
|
26
|
+
import "dayjs";
|
|
27
|
+
import "element-plus/es";
|
|
28
|
+
import "core-js/modules/es.error.cause.js";
|
|
29
|
+
import "@babel/runtime/helpers/esm/defineProperty";
|
|
30
|
+
import "core-js/modules/es.json.stringify.js";
|
|
31
|
+
import "axios";
|
|
32
|
+
import "qs";
|
|
33
|
+
import "vue-request";
|
|
34
|
+
import "core-js/modules/es.array.includes.js";
|
|
35
|
+
import "core-js/modules/es.iterator.some.js";
|
|
36
|
+
import "core-js/modules/es.object.has-own.js";
|
|
37
|
+
import "xe-utils";
|
|
38
|
+
import "js-cookie";
|
|
39
|
+
import "vxe-pc-ui";
|
|
40
|
+
import "vxe-table";
|
|
41
|
+
import "vxe-table-plugin-element";
|
|
42
|
+
const __default__ = defineComponent({ "setup": true, "name": "Redirect" });
|
|
43
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
44
|
+
...__default__,
|
|
45
|
+
__name: "redirect",
|
|
46
|
+
__ssrInlineRender: true,
|
|
47
|
+
setup(__props) {
|
|
48
|
+
const route = useRoute();
|
|
49
|
+
const router = useRouter();
|
|
50
|
+
const fullPath = route.params.path;
|
|
51
|
+
onMounted(() => router.replace(fullPath));
|
|
52
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
53
|
+
_push(`<span${ssrRenderAttrs(_attrs)}></span>`);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const _sfc_setup = _sfc_main.setup;
|
|
58
|
+
_sfc_main.setup = (props, ctx) => {
|
|
59
|
+
const ssrContext = useSSRContext();
|
|
60
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/redirect.vue");
|
|
61
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
_sfc_main as default
|
|
65
|
+
};
|