fix: reset proxy

index
guofei 2024-06-01 14:45:50 +08:00
parent e87316cc50
commit 5b951eb5df
2 changed files with 29 additions and 27 deletions

View File

@ -1,4 +1,4 @@
var BaseUrl = "/api/";
var BaseUrl = "http://api.soyootech.com/";
export async function UserLogin(loginForm) {
try {
var response = await fetch(BaseUrl + "SoyooUser/previewlogin", {
@ -12,7 +12,9 @@ export async function UserLogin(loginForm) {
method: "POST",
});
var result = await response.json();
result.permissionPages = result.permissionPages.map((permission) => permission.toLowerCase());
result.permissionPages = result.permissionPages.map((permission) =>
permission.toLowerCase()
);
return result;
} catch (error) {
console.log(error);

View File

@ -1,12 +1,12 @@
const { createProxyMiddleware } = require("http-proxy-middleware");
module.exports = function (app) {
app.use(
"/api", // 这是路径模式
createProxyMiddleware({
target: "https://api.soyootech.com/", // 目标服务器地址
changeOrigin: true,
pathRewrite: { "^/api": "" },
})
);
// app.use(
// "/api",
// createProxyMiddleware({
// target: "https://api.soyootech.com/",
// changeOrigin: true,
// pathRewrite: { "^/api": "" },
// })
// );
};