æ·feat: commplete init process

This commit is contained in:
engigu
2023-12-30 17:40:20 +08:00
parent 9307bec4ab
commit 77af985b76
92 changed files with 12054 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
import useClipboard from "vue-clipboard3";
import { ElMessage } from 'element-plus'
function copyToClipboard(obj) {
const { toClipboard } = useClipboard();
try {
if (!obj) {
ElMessage({
message: `复制内容为空`,
type: 'error',
})
} else {
toClipboard(obj);
ElMessage({
message: '复制成功',
type: 'success',
})
}
} catch (e) {
ElMessage({
message: `复制失败,${e}`,
type: 'error',
})
}
};
export { copyToClipboard };
+28
View File
@@ -0,0 +1,28 @@
const gethttpOrigin = () => {
return window.location.origin
}
class ApiStrGenerate {
static getCurlString(task_id, options) {
let data = { task_id: task_id };
data.text = 'Hello World!';
if (options.html) {
data.html = '<h1> Hello World! </h1>';
}
if (options.markdown) {
data.html = '** Hello World! **';
}
let dataStr = JSON.stringify(data, null, 4)
let example = `curl -X POST --location '${gethttpOrigin()}/api/v1/message/send' \\
--header 'Accept: application/json' \\
--data '${dataStr}'`;
return example;
}
}
export { ApiStrGenerate };