机器人显示名与站点标题可配;多段联运列表投影;协同群监听对账;工单附件落存;模板与工单后台补强
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* 管理后台品牌标题:默认文案 + 可配置项(落 inq_bot_reply)。
|
||||
* 登录前用默认;登录后 refresh 一次,侧栏/浏览器标签同步。
|
||||
* 配置页:系统配置 → 后台名称。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import { getReplyListAll } from '/@/views/inquiry/botReply/botReply.api';
|
||||
|
||||
/** 产品默认名;库中无配置时全站用此文案 */
|
||||
export const DEFAULT_ADMIN_SITE_TITLE = '友通达智价通AIQ管理后台';
|
||||
|
||||
/** 与机器人显示名同表;独立 reply_code,不进回复语业务分类 */
|
||||
export const ADMIN_SITE_TITLE_REPLY_CODE = 'system.admin_site_title';
|
||||
|
||||
/** 当前生效的后台名称(侧栏品牌、登录页、浏览器标签后缀) */
|
||||
export const adminSiteTitle = ref(DEFAULT_ADMIN_SITE_TITLE);
|
||||
|
||||
/**
|
||||
* 从主账拉取已保存的后台名称。
|
||||
* 失败或未配置时保持默认,不抛错打断布局。
|
||||
*/
|
||||
export async function refreshAdminSiteTitle(): Promise<string> {
|
||||
try {
|
||||
const res: any = await getReplyListAll();
|
||||
const list = Array.isArray(res)
|
||||
? res
|
||||
: Array.isArray(res?.result)
|
||||
? res.result
|
||||
: Array.isArray(res?.records)
|
||||
? res.records
|
||||
: [];
|
||||
const hit = list.find((r: any) => String(r.replyCode || '') === ADMIN_SITE_TITLE_REPLY_CODE);
|
||||
const enabled = !hit || hit.enabled === 1 || hit.enabled === true;
|
||||
const name = enabled ? String(hit?.replyText || '').trim() : '';
|
||||
adminSiteTitle.value = name || DEFAULT_ADMIN_SITE_TITLE;
|
||||
} catch {
|
||||
adminSiteTitle.value = DEFAULT_ADMIN_SITE_TITLE;
|
||||
}
|
||||
return adminSiteTitle.value;
|
||||
}
|
||||
Reference in New Issue
Block a user