fix(auth): 修复 mixed-content 问题,将认证接口改为相对路径并走代理
This commit is contained in:
parent
95c75ce331
commit
da3fad3b44
@ -38,7 +38,7 @@ describe('Auth Store', () => {
|
|||||||
|
|
||||||
expect(fetchMock).toHaveBeenCalledTimes(1)
|
expect(fetchMock).toHaveBeenCalledTimes(1)
|
||||||
expect(fetchMock).toHaveBeenCalledWith(
|
expect(fetchMock).toHaveBeenCalledWith(
|
||||||
'http://test.xueai.art/newapi/api/login/validateToken',
|
'/api/auth/login/validateToken',
|
||||||
{
|
{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@ -35,7 +35,7 @@ interface AuthResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 认证接口
|
// 认证接口
|
||||||
const AUTH_CHECK_URL = 'http://test.xueai.art/newapi/api/login/validateToken';
|
const AUTH_CHECK_URL = '/newapi/api/login/validateToken';
|
||||||
const AUTH_TOKEN_STORAGE_KEY = 'DEV_DEFAULT_TOKEN';
|
const AUTH_TOKEN_STORAGE_KEY = 'DEV_DEFAULT_TOKEN';
|
||||||
|
|
||||||
export const useAuthStore = defineStore('auth', () => {
|
export const useAuthStore = defineStore('auth', () => {
|
||||||
|
|||||||
@ -21,8 +21,8 @@ export default defineConfig({
|
|||||||
target: "http://localhost:8002", // Python服务器端口
|
target: "http://localhost:8002", // Python服务器端口
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/api/auth": {
|
"/newapi/api": {
|
||||||
target: "https://sxwz.xueai.art",
|
target: "http://test.xueai.art",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user