功能:完善门店能力与用户安全配置
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Front-end API wrapper for this module.
|
||||
* Call guide: import the named API object, then call the matching method from a Vue page or composable.
|
||||
*/
|
||||
import axios, { AxiosError } from 'axios'
|
||||
import { authApi } from './auth'
|
||||
import { adminAuthApi } from './admin'
|
||||
@@ -58,6 +62,8 @@ const isAuthFreePath = (url?: string) => {
|
||||
'/user/phone-login',
|
||||
'/user/wechat-mini/',
|
||||
'/user/reset-password-by-phone',
|
||||
'/legal-agreement/current',
|
||||
'/api/legal-agreement/current',
|
||||
'/product/get/',
|
||||
'/product/list/',
|
||||
'/comment/list/product/',
|
||||
@@ -149,6 +155,7 @@ api.interceptors.response.use(
|
||||
url?.includes('/user/refresh-token') ||
|
||||
url?.includes('/user/send-verification-code') ||
|
||||
url?.includes('/user/phone-login') ||
|
||||
url?.includes('/legal-agreement/current') ||
|
||||
url?.includes('/product/get/') ||
|
||||
url?.includes('/product/list/') ||
|
||||
url?.includes('/comment/list/product/') ||
|
||||
@@ -235,7 +242,17 @@ api.interceptors.response.use(
|
||||
}
|
||||
)
|
||||
|
||||
/**
|
||||
* fileApi groups all API calls for this page domain.
|
||||
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
||||
*/
|
||||
export const fileApi = {
|
||||
/**
|
||||
* `getSignedUrl` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
||||
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
||||
* @param fileId: IdType caller-supplied value for `fileId: IdType`
|
||||
* @param expiryTimeInMinutes?: number caller-supplied value for `expiryTimeInMinutes?: number`
|
||||
*/
|
||||
getSignedUrl: (fileId: IdType, expiryTimeInMinutes?: number) => {
|
||||
return api.get<string>(`/file/get-signed-url/${fileId}`, {
|
||||
params: { expiryTimeInMinutes }
|
||||
|
||||
Reference in New Issue
Block a user