update: 优化部署
This commit is contained in:
@@ -31,11 +31,12 @@ type Options = {
|
||||
hash?: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
export const fetchLink = async (url: string, opts?: Options) => {
|
||||
export const fetchLink = async (url: string = '', opts?: Options) => {
|
||||
const token = process.env.KEVISUAL_TOKEN || storage.getItem('token');
|
||||
const fetchURL = new URL(url);
|
||||
const check = opts?.check ?? false;
|
||||
const setToken = opts?.setToken ?? true;
|
||||
const isKevisual = !!url.includes('kevisual');
|
||||
const setToken = opts?.setToken ?? isKevisual;
|
||||
if (check) {
|
||||
if (!url.startsWith(baseURL)) {
|
||||
throw new Error('url must start with ' + baseURL);
|
||||
|
||||
Reference in New Issue
Block a user