Browse Source

提交

master
ting 5 months ago
parent
commit
eb047f2c07
  1. 3
      index.html
  2. 2
      src/axios/ShowApi.js
  3. 14
      src/views/backindex.vue
  4. 16
      vite.config.js

3
index.html

@ -11,9 +11,8 @@
<script type="module" src="/src/main.js"></script>
</body>
</html>
<style>
body{
margin: 0;
margin: 0;
}
</style>

2
src/axios/ShowApi.js

@ -3,7 +3,7 @@ import service from ".";
const ShowApi = {
//获取众筹信息
showPage(){
return service.get('/page');
return service.get('https://api.homilychart.com/crowdfunding/page');
}
}

14
src/views/backindex.vue

@ -14,7 +14,7 @@ const deleteInfo = ref(false);
const info = ref({});
const getInfo = async function () {
try {
const result = await axios.get("http://192.168.9.117:8092/page");
const result = await axios.get("https://api.homilychart.com/crowdfunding/page");
info.value.title = result.data.data.title;
info.value.targetNumber = result.data.data.targetNumber;
} catch (error) {
@ -34,7 +34,7 @@ const putTitle = async function () {
formData.append(key, titleNew.value[key]);
}
const result = await axios.put(
"http://192.168.9.117:8092/title",
"https://api.homilychart.com/crowdfunding/title",
formData,
{
headers: {
@ -69,7 +69,7 @@ const putTargetNumber = async function () {
formData.append(key, targetNumberNew.value[key]);
}
const result = await axios.put(
"http://192.168.9.117:8092/target",
"https://api.homilychart.com/crowdfunding/target",
formData,
{
headers: {
@ -102,7 +102,7 @@ const tableData = ref([]);
const get = async function () {
try {
const result = await axios.post(
"http://192.168.9.117:8092/users",
"https://api.homilychart.com/crowdfunding/users",
search.value
);
tableData.value = result.data.data;
@ -117,7 +117,7 @@ const add = ref({});
const addUser = async function () {
try {
const result = await axios.post(
"http://192.168.9.117:8092/addUser",
"https://api.homilychart.com/crowdfunding/addUser",
add.value
);
if (result.data.code == 10000) {
@ -146,7 +146,7 @@ function deleteRow(value) {
const tureDelete = async function () {
try {
const result = await axios.delete(
"http://192.168.9.117:8092/delUser/" + idname.value
"https://api.homilychart.com/crowdfunding/delUser/" + idname.value
);
if (result.data.code == 10000) {
ElMessage.success("修改成功");
@ -172,7 +172,7 @@ const searchBy = ref({
const searchByJwcodeAndIdentity = async function () {
try {
const result = await axios.post(
"http://192.168.9.117:8092/users",
"https://api.homilychart.com/crowdfunding/users",
searchBy.value
);
if (result.data.code == 10000) {

16
vite.config.js

@ -16,13 +16,13 @@ export default defineConfig({
},
},
server: {
proxy: {
'/api': {
//后端服务器地址
target: 'http://192.168.9.117:8092',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
// proxy: {
// '/api': {
// //后端服务器地址
// target: 'https://api.homilychart.com/crowdfunding',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, '')
// }
// }
}
})
Loading…
Cancel
Save