|
@@ -548,7 +548,7 @@ const importFromJson = () => {
|
|
|
//从服务器获取模板
|
|
|
const importFromJsonServer = async (itemId) => {
|
|
|
try {
|
|
|
- const url = new URL('http://localhost:8080/api/template');
|
|
|
+ const url = new URL(process.env.TEMPLATE_API_URL+'template');
|
|
|
url.searchParams.append('name', itemId);
|
|
|
const response = await fetch(url, {
|
|
|
headers: {
|
|
@@ -577,7 +577,7 @@ const importFromJsonServer = async (itemId) => {
|
|
|
let search = ref('')
|
|
|
const searchTemplate = async () => {
|
|
|
try {
|
|
|
- const url = new URL('http://localhost:8080/api/search');
|
|
|
+ const url = new URL(process.env.TEMPLATE_API_URL+'search');
|
|
|
url.searchParams.append('name', search.value);
|
|
|
const response = await fetch(url, {
|
|
|
headers: {
|
|
@@ -609,7 +609,7 @@ const DeleteeFromJsonServer = async (itemId) => {
|
|
|
type: 'warning',
|
|
|
}).then(async () => {
|
|
|
try {
|
|
|
- const url = new URL('http://localhost:8080/api/template');
|
|
|
+ const url = new URL(process.env.TEMPLATE_API_URL+'template');
|
|
|
url.searchParams.append('name', itemId);
|
|
|
const response = await fetch(url, {
|
|
|
method: 'DELETE',
|
|
@@ -689,7 +689,7 @@ const savetemplate = async (types) => {
|
|
|
onlySelected: exportOnlySelected.value
|
|
|
})
|
|
|
try {
|
|
|
- const response = await fetch('http://localhost:8080/api/saveTemplate', {
|
|
|
+ const response = await fetch(process.env.TEMPLATE_API_URL+'saveTemplate', {
|
|
|
method: 'POST',
|
|
|
headers: {
|
|
|
'Content-Type': 'application/json'
|
|
@@ -722,7 +722,7 @@ async function getTemplats() {
|
|
|
const fileName = getQueryParams(url);
|
|
|
if (fileName.fileName != undefined) {
|
|
|
try {
|
|
|
- const url = new URL('http://localhost:8080/api/template');
|
|
|
+ const url = new URL(process.env.TEMPLATE_API_URL+'template');
|
|
|
url.searchParams.append('name', fileName.fileName);
|
|
|
const response = await fetch(url, {
|
|
|
headers: {
|
|
@@ -747,7 +747,7 @@ const templateItems = async () => {
|
|
|
};
|
|
|
names.clear() //清空map 重新渲染
|
|
|
try {
|
|
|
- const response = await fetch('http://localhost:8080/api/template', {
|
|
|
+ const response = await fetch(process.env.TEMPLATE_API_URL+'template', {
|
|
|
method: 'POST',
|
|
|
headers: {
|
|
|
'Content-Type': 'application/json',
|