fix: reset proxy
parent
e87316cc50
commit
5b951eb5df
|
@ -1,4 +1,4 @@
|
||||||
var BaseUrl = "/api/";
|
var BaseUrl = "http://api.soyootech.com/";
|
||||||
export async function UserLogin(loginForm) {
|
export async function UserLogin(loginForm) {
|
||||||
try {
|
try {
|
||||||
var response = await fetch(BaseUrl + "SoyooUser/previewlogin", {
|
var response = await fetch(BaseUrl + "SoyooUser/previewlogin", {
|
||||||
|
@ -12,7 +12,9 @@ export async function UserLogin(loginForm) {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
});
|
});
|
||||||
var result = await response.json();
|
var result = await response.json();
|
||||||
result.permissionPages = result.permissionPages.map((permission) => permission.toLowerCase());
|
result.permissionPages = result.permissionPages.map((permission) =>
|
||||||
|
permission.toLowerCase()
|
||||||
|
);
|
||||||
return result;
|
return result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
const { createProxyMiddleware } = require("http-proxy-middleware");
|
const { createProxyMiddleware } = require("http-proxy-middleware");
|
||||||
|
|
||||||
module.exports = function (app) {
|
module.exports = function (app) {
|
||||||
app.use(
|
// app.use(
|
||||||
"/api", // 这是路径模式
|
// "/api",
|
||||||
createProxyMiddleware({
|
// createProxyMiddleware({
|
||||||
target: "https://api.soyootech.com/", // 目标服务器地址
|
// target: "https://api.soyootech.com/",
|
||||||
changeOrigin: true,
|
// changeOrigin: true,
|
||||||
pathRewrite: { "^/api": "" },
|
// pathRewrite: { "^/api": "" },
|
||||||
})
|
// })
|
||||||
);
|
// );
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue