This commit is contained in:
parent
174a4699b2
commit
53e70cbde4
@ -46,3 +46,11 @@ export function listMusic() {
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadImg(data) {
|
||||
return request({
|
||||
url: "/file/upload",
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
@ -29,7 +29,7 @@ const data = reactive({
|
||||
onMounted(async () => {
|
||||
// 8834041785
|
||||
const res = await fetch("https://met.hxyouzi.com/meting-api/?server=tencent&type=playlist&id=7567066822")
|
||||
// const res = await fetch("https://met.hxyouzi.com/meting-api/?server=tencent&type=playlist&id=8834041785")
|
||||
// const res = await fetch("https://api.moeyao.cn/meting/?server=tencent&type=playlist&id=8834041785")
|
||||
const mlist = await res.json()
|
||||
data.audio = []
|
||||
mlist.forEach(i => {
|
||||
|
20
src/util/lsky.js
Normal file
20
src/util/lsky.js
Normal file
@ -0,0 +1,20 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const token = "Bearer " + "1|YbgN4rXb5pj225CNuMNj20fxbpo2xGHliGxtTWDH"
|
||||
|
||||
let baseURL = 'https://pic.hxyouzi.com/api/v1';
|
||||
|
||||
let headers = {
|
||||
'Content-Type': 'application/form-data',
|
||||
'Authorization': token,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
const request = axios.create({
|
||||
baseURL,
|
||||
headers
|
||||
});
|
||||
|
||||
|
||||
export function uploadImage(data) {
|
||||
return request.post('/upload', data);
|
||||
}
|
@ -4,6 +4,7 @@ import cookie from 'vue-cookies';
|
||||
import router from '../router/index.js';
|
||||
|
||||
let baseURL = import.meta.env.VITE_APP_BASE_URL + '/api';
|
||||
// let baseURL = 'http://127.0.0.1:7777/api';
|
||||
|
||||
let headers = {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
|
@ -1,8 +1,10 @@
|
||||
<template>
|
||||
<div class="div w-[100%]" ref="gw">
|
||||
<div class="list px-3">
|
||||
<n-upload style="height: 200px; width: 50%" multiple directory-dnd action="https://www.hxyouzi.com/api/file/upload"
|
||||
accept="image/*" :headers="{ Authorization: token }" :show-file-list="false" :on-finish="fileFinish">
|
||||
<n-upload style="height: 200px; width: 50%" multiple directory-dnd action="https://pic.hxyouzi.com/api/v1/upload"
|
||||
accept="image/*" :data="{ strategy_id: 2 }"
|
||||
:headers="{ Authorization: 'Bearer ' + '1|YbgN4rXb5pj225CNuMNj20fxbpo2xGHliGxtTWDH' }" :show-file-list="false"
|
||||
:on-finish="fileFinish">
|
||||
<n-upload-dragger>
|
||||
<div style="margin-bottom: 12px">
|
||||
<n-icon size="48" class="up">
|
||||
@ -60,9 +62,15 @@ const bottomLen = ref(20)
|
||||
// console.log(4444, size.conH);
|
||||
const list = ref([]);
|
||||
const token = cookie.get("token");
|
||||
function fileFinish(file) {
|
||||
async function fileFinish(file) {
|
||||
const res = JSON.parse(file.event.currentTarget.response);
|
||||
// console.log(res);
|
||||
console.log("返回文件",res);
|
||||
const r = await $http.file.uploadImg({
|
||||
url: res.data.links.url,
|
||||
filename : res.data.origin_name,
|
||||
});
|
||||
console.log("上传服务器",r);
|
||||
|
||||
if (res.code == 1) {
|
||||
$msg.success(res.msg);
|
||||
getMyfile();
|
||||
@ -302,6 +310,7 @@ onMounted(() => {
|
||||
|
||||
:deep(.n-image) {
|
||||
display: flex;
|
||||
|
||||
img {
|
||||
width: 200px;
|
||||
height: auto;
|
||||
|
Loading…
Reference in New Issue
Block a user