修改前端 api 路径

This commit is contained in:
flykhan 2023-03-12 11:34:13 +08:00
parent dbbfb700e4
commit 304f2fbd0c
5 changed files with 10 additions and 10 deletions

View File

@ -11,7 +11,7 @@ export default {
add(context, data) {
// 新建 bot
$.ajax({
url: "http://localhost:3000/user/bot/add/",
url: "http://localhost:3001/api/user/bot/add/",
type: "POST",
data: {
title: data.title,
@ -33,7 +33,7 @@ export default {
remove(context, data) {
// 移除 bot
$.ajax({
url: "http://localhost:3000/user/bot/remove/",
url: "http://localhost:3001/api/user/bot/remove/",
type: "POST",
data: {
bot_id: data.bot_id,
@ -57,7 +57,7 @@ export default {
update(context, data) {
// 更新 bot
$.ajax({
url: "http://localhost:3000/user/bot/update/",
url: "http://localhost:3001/api/user/bot/update/",
type: "POST",
data: {
bot_id: data.bot_id,
@ -80,7 +80,7 @@ export default {
getList(context, data) {
// 获取 Bot 列表
$.ajax({
url: "http://localhost:3000/user/bot/getlist/",
url: "http://localhost:3001/api/user/bot/getlist/",
type: "GET",
headers: {
Authorization: "Bearer " + store.state.user.token,

View File

@ -25,7 +25,7 @@ export default {
getRecordList(context, data) {
// 获取 Bot 列表
$.ajax({
url: "http://localhost:3000/record/getlist/",
url: "http://localhost:3001/api/record/getlist/",
data: {
page_index: data.page,
},

View File

@ -41,7 +41,7 @@ export default {
// 登录函数
login(context, data) {
$.ajax({
url: "http://localhost:3000/user/account/token/",
url: "http://localhost:3001/api/user/account/token/",
type: "POST",
data: {
username: data.username,
@ -71,7 +71,7 @@ export default {
// 注册函数
register(context, data) {
$.ajax({
url: "http://localhost:3000/user/account/register/",
url: "http://localhost:3001/api/user/account/register/",
type: "POST",
data: {
username: data.username,
@ -94,7 +94,7 @@ export default {
// 获取登录成功后的用户信息
getinfo(context, data) {
$.ajax({
url: "http://localhost:3000/user/account/info/",
url: "http://localhost:3001/api/user/account/info/",
type: "GET",
headers: {
Authorization: "Bearer " + context.state.token,

View File

@ -29,7 +29,7 @@ export default {
setup() {
const store = useStore();
// url, 使 ws
const socketUrl = `ws://127.0.0.1:3000/websocket/${store.state.user.token}/`;
const socketUrl = `ws://127.0.0.1:3001/websocket/${store.state.user.token}/`;
let socket = null;

View File

@ -91,7 +91,7 @@ export default {
const pull_ranklist_page = (page) => {
current_page = page;
$.ajax({
url: "http://127.0.0.1:3000/ranklist/getranklist/",
url: "http://localhost:3001/api/ranklist/getranklist/",
data: {
page_index:page,
},