Compare commits
No commits in common. "main" and "fixbug-2.45" have entirely different histories.
main
...
fixbug-2.4
@ -83,8 +83,7 @@ const consultItems = ref([
|
||||
]);
|
||||
const hideMenus = computed(() => {
|
||||
const result = {};
|
||||
// 非医助手团队
|
||||
if (!(props.team && props.team.createSource === 'yzs')) {
|
||||
if (!props.team || !props.team.creator) {
|
||||
result.chat = true;
|
||||
}
|
||||
return result;
|
||||
@ -93,7 +92,7 @@ const hideMenus = computed(() => {
|
||||
function handleItemClick(item) {
|
||||
// 聊天咨询需要选择咨询人
|
||||
if (item.needSelectConsultant) {
|
||||
if (!(props.team && props.team.createSource === 'yzs')) {
|
||||
if (!props.team || !props.team.creator) {
|
||||
return toast('该团队暂未开放咨询服务')
|
||||
}
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ const hasHealthTemp = computed(
|
||||
() =>
|
||||
qrcode.value &&
|
||||
Array.isArray(qrcode.value.healthTempList) &&
|
||||
qrcode.value.healthTempList.filter(i => i && i.enable).length > 0
|
||||
qrcode.value.healthTempList.length > 0
|
||||
);
|
||||
const baseInfo = computed(() =>
|
||||
qrcode.value &&
|
||||
|
||||
@ -6,10 +6,6 @@ export const CORP_API_BASE_URL_MAP = {
|
||||
wwa54dfba0b5441ef1: "https://crm.gykqyy.com/ykt/",
|
||||
};
|
||||
|
||||
export const CORP_ID_ALIAS_MAP = {
|
||||
"wpLgjyawAAeRkCPQMp9-z5q-xEzK64nA": "wwa54dfba0b5441ef1",
|
||||
};
|
||||
|
||||
function normalizeBaseUrl(url) {
|
||||
return String(url || "").replace(/\/+$/, "");
|
||||
}
|
||||
@ -18,11 +14,6 @@ function getDefaultBaseUrl() {
|
||||
return normalizeBaseUrl(env.MP_API_BASE_URL);
|
||||
}
|
||||
|
||||
export function normalizeCorpId(corpId) {
|
||||
const normalizedCorpId = String(corpId || "").trim();
|
||||
return CORP_ID_ALIAS_MAP[normalizedCorpId] || normalizedCorpId;
|
||||
}
|
||||
|
||||
function readCachedContext() {
|
||||
if (typeof uni === "undefined" || typeof uni.getStorageSync !== "function") {
|
||||
return null;
|
||||
@ -84,12 +75,12 @@ function parseQueryString(queryString) {
|
||||
export function getCorpIdFromAppOptions(options = {}) {
|
||||
const query = options.query || options || {};
|
||||
const corpId = query.corpId || query.corpid || query.corp_id;
|
||||
if (corpId) return normalizeCorpId(corpId);
|
||||
if (corpId) return String(corpId).trim();
|
||||
|
||||
if (typeof query.q === "string") {
|
||||
const qParams = parseQueryString(safeDecode(query.q));
|
||||
const qCorpId = qParams.corpId || qParams.corpid || qParams.corp_id;
|
||||
if (qCorpId) return normalizeCorpId(qCorpId);
|
||||
if (qCorpId) return String(qCorpId).trim();
|
||||
}
|
||||
|
||||
return "";
|
||||
@ -102,7 +93,7 @@ export function initApiContextFromAppOptions(options = {}) {
|
||||
}
|
||||
|
||||
export function resolveApiContext(corpId) {
|
||||
const normalizedCorpId = normalizeCorpId(corpId);
|
||||
const normalizedCorpId = String(corpId || "").trim();
|
||||
|
||||
if (normalizedCorpId) {
|
||||
const configuredBaseUrl = CORP_API_BASE_URL_MAP[normalizedCorpId];
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { loading, hideLoading } from "./widget";
|
||||
import { buildApiUrl, getDefaultUploadUrl, normalizeCorpId } from "./api-base-config";
|
||||
import { buildApiUrl, getDefaultUploadUrl } from "./api-base-config";
|
||||
|
||||
const defaultOptions = {
|
||||
header: {
|
||||
@ -96,12 +96,6 @@ async function refreshAccessToken() {
|
||||
const request = async (options = {}, showLoading = true) => {
|
||||
// 合并用户传入的配置和默认配置
|
||||
if (!options.data) options.data = {};
|
||||
if (options.data.corpId) {
|
||||
options.data = {
|
||||
...options.data,
|
||||
corpId: normalizeCorpId(options.data.corpId),
|
||||
};
|
||||
}
|
||||
|
||||
const config = {
|
||||
...defaultOptions,
|
||||
@ -207,13 +201,12 @@ export default request;
|
||||
export const uploadUrl = getDefaultUploadUrl();
|
||||
|
||||
export function getFullPath(path, corpId) {
|
||||
return buildApiUrl(path, normalizeCorpId(corpId));
|
||||
return buildApiUrl(path, corpId);
|
||||
}
|
||||
|
||||
|
||||
export function upload(path, corpId) {
|
||||
const normalizedCorpId = normalizeCorpId(corpId);
|
||||
const currentUploadUrl = buildApiUrl("/upload", normalizedCorpId);
|
||||
const currentUploadUrl = buildApiUrl("/upload", corpId);
|
||||
return new Promise((resolve) => {
|
||||
uni.uploadFile({
|
||||
url: currentUploadUrl,
|
||||
@ -223,7 +216,7 @@ export function upload(path, corpId) {
|
||||
success: (res) => {
|
||||
try {
|
||||
const url = JSON.parse(res.data).filePath;
|
||||
resolve(url ? getFullPath(url, normalizedCorpId) : '')
|
||||
resolve(url ? getFullPath(url, corpId) : '')
|
||||
} catch (e) {
|
||||
resolve()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user