修改判断逻辑

v1.4.0
于肖磊 2025-08-08 18:51:56 +08:00
parent a492eb0a7d
commit 7ca12ec6e9
2 changed files with 4 additions and 3 deletions

View File

@ -1,12 +1,13 @@
import { get_type } from '@/utils/common';
import request from '@/utils/request';
import api_request from '@/utils/api-request';
import { isEmpty } from 'lodash';
class CommonAPI {
/** 链接初始化接口 */
static getInit() {
if (get_type() == 'shop') {
return request({
return api_request({
url: `?s=plugins/index/pluginsname/shop/pluginscontrol/diyapi/pluginsaction/init.html`,
method: 'post',
});

View File

@ -20,7 +20,7 @@ export const font_weight = [
export const get_id = () => {
let new_id = '';
// 去除origin的数据
const url = document.location.href.replace(document.location.origin, '');
const url = document.location.href;
if (url.indexOf('id/') != -1) {
new_id = url.substring(url.indexOf('id/') + 3);
// 去除字符串的.html
@ -45,7 +45,7 @@ export const get_id = () => {
export const get_type = () => {
let new_type = '';
// 去除origin的数据
const url = document.location.href.replace(document.location.origin, '');
const url = document.location.href;
if (url.indexOf('type/') != -1) {
new_type = url.substring(url.indexOf('type/') + 5);
// 去除字符串的.html