Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): appid confict if open 2 tabs #1011

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions web/src/apis/v1/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
///////////////////////////////////////////////////////////////////////
/// <reference path = "api-auto.d.ts" />
import request from "@/utils/request";
import useGlobalStore from "@/pages/globalStore";

/**
* Get account info
Expand All @@ -17,7 +18,7 @@ export async function AccountControllerFindOne(
): Promise<Paths.AccountControllerFindOne.Responses> {
// /v1/accounts
let _params: { [key: string]: any } = {
appid: localStorage.getItem("app"),
appid: useGlobalStore.getState().currentApp?.appid || "",
...params,
};
return request(`/v1/accounts`, {
Expand All @@ -34,7 +35,7 @@ export async function AccountControllerGetChargeOrder(
): Promise<Paths.AccountControllerGetChargeOrder.Responses> {
// /v1/accounts/charge-order/{id}
let _params: { [key: string]: any } = {
appid: localStorage.getItem("app"),
appid: useGlobalStore.getState().currentApp?.appid || "",
...params,
};
return request(`/v1/accounts/charge-order/${_params.id}`, {
Expand All @@ -51,7 +52,7 @@ export async function AccountControllerCharge(
): Promise<Paths.AccountControllerCharge.Responses> {
// /v1/accounts/charge-order
let _params: { [key: string]: any } = {
appid: localStorage.getItem("app"),
appid: useGlobalStore.getState().currentApp?.appid || "",
...params,
};
return request(`/v1/accounts/charge-order`, {
Expand All @@ -68,7 +69,7 @@ export async function AccountControllerWechatNotify(
): Promise<Paths.AccountControllerWechatNotify.Responses> {
// /v1/accounts/payment/wechat-notify
let _params: { [key: string]: any } = {
appid: localStorage.getItem("app"),
appid: useGlobalStore.getState().currentApp?.appid || "",
...params,
};
return request(`/v1/accounts/payment/wechat-notify`, {
Expand Down
7 changes: 4 additions & 3 deletions web/src/apis/v1/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
///////////////////////////////////////////////////////////////////////
/// <reference path = "api-auto.d.ts" />
import request from "@/utils/request";
import useGlobalStore from "@/pages/globalStore";

/**
* Get user application list
Expand All @@ -17,7 +18,7 @@ export async function ApplicationControllerFindAll(
): Promise<Paths.ApplicationControllerFindAll.Responses> {
// /v1/applications
let _params: { [key: string]: any } = {
appid: localStorage.getItem("app"),
appid: useGlobalStore.getState().currentApp?.appid || "",
...params,
};
return request(`/v1/applications`, {
Expand All @@ -34,7 +35,7 @@ export async function ApplicationControllerFindOne(
): Promise<Paths.ApplicationControllerFindOne.Responses> {
// /v1/applications/{appid}
let _params: { [key: string]: any } = {
appid: localStorage.getItem("app"),
appid: useGlobalStore.getState().currentApp?.appid || "",
...params,
};
return request(`/v1/applications/${_params.appid}`, {
Expand All @@ -51,7 +52,7 @@ export async function ApplicationControllerUpdate(
): Promise<Paths.ApplicationControllerUpdate.Responses> {
// /v1/applications/{appid}
let _params: { [key: string]: any } = {
appid: localStorage.getItem("app"),
appid: useGlobalStore.getState().currentApp?.appid || "",
...params,
};
return request(`/v1/applications/${_params.appid}`, {
Expand Down
Loading