登录页配置通过脚本插入数据指导
一、场景
客户环境限制不允许上传图片文件,需要个性化登录页,通过脚本插入登录页配置数据。
二、实现步骤
以下介绍插入环境中扩展js、登录时扩展js、登录页图片3类数据的操作步骤,请根据现场实际需求选择对应数据的指导方案进行操作,如无需使用扩展js则无需插入该数据。
1、环境中扩展js
操作步骤:
(1)在mc数据库中插入脚本,脚本需要根据环境做调整,说明如下
INSERT INTO t_mc_datasave
(FID, fkey, fvalue, fdcid, fvalue_tag)
VALUES(1133982885749981185, '_tenant_login_config_files_', '[{"lastModified":1601275353680,"name":"customjs.zip","size":680,"status":"success","type":"zip","uid":"rc-upload-1677648567384-64","url":"%2Fcustomjs.zip","uploadTime":1677661948634,"creator":{"zh_CN":"IERP"},"createdate":1677661948634,"createtime":1677661948634,"filesource":1,"entityNum":"sys_login_config","billPkId":"","billno":"","client":"web","endProgress":true,"time":"1677661973484"}]', 'tenant_devcore_dev', ' ');
说明:
fdcid字段值替换为对应环境的租户id
INSERT INTO t_mc_web_client_files
(FID, fisv, fuploadtime, fupdateservertime, fenable, fneedupdate, fkey, fdcid, fname, ffileserverpath, fservertype, fdestpath, ftenantid)
VALUES(1478324783346089985, 'kingdee', '2022-08-02 16:47:27.0', NULL, '1', '1', '_tenant_login_config_tenant_devcore_dev_attachfiles', '1402323749146986496', 'customjs.zip', '', 'FS', 'globalfiles', 'tenant_devcore_dev');
说明:
-- fisv字段值替换为对应客户的开发商标识,
-- fdcid字段值替换为对应环境的数据中心id,
-- ftenantid字段值替换为对应环境的租户id,
-- fkey字段值替换为"_tenant_login_config_{租户id}_attachfiles",如:_tenant_login_config_tenant_devcore_dev_attachfiles
(2)插入完sql之后,需要手动上传文件到静态资源文件目录
环境中扩展js上传路径:
../isv/{isv}/globalfiles/,{isv}替换为对应客户的开发商标识,将上传的压缩文件在该目录下解压,解压时不要带压缩包文件名目录
如:../isv/kingdee/globalfiles/index.js
2、登录时扩展js
操作步骤:
(1)在mc数据库中插入脚本,脚本需要根据环境做调整,说明如下
INSERT INTO t_mc_datasave
(FID, fkey, fvalue, fdcid, fvalue_tag)
VALUES(1133982885749981184, '_tenant_loginpage_config_files_', '[{"lastModified":1668764659537,"name":"login_customjs.zip","size":826,"status":"success","type":"zip","uid":"rc-upload-1677648567384-66","url":"%2Flogin_customjs.zip","uploadTime":1677662144142,"creator":{"zh_CN":"IERP"},"createdate":1677662144142,"createtime":1677662144142,"filesource":1,"entityNum":"sys_login_config","billPkId":"","billno":"","client":"web","endProgress":true,"time":"1677662184879"}]', 'tenant_devcore_dev', ' ');
说明:
fdcid字段值替换为对应环境的租户id
INSERT INTO t_mc_web_client_files
(FID, fisv, fuploadtime, fupdateservertime, fenable, fneedupdate, fkey, fdcid, fname, ffileserverpath, fservertype, fdestpath, ftenantid)
VALUES(1478324783346089984, 'kingdee', '2022-08-02 16:47:27.0', NULL, '1', '1', '_tenant_login_config_tenant_devcore_dev_loginpageattachfiles', '1402323749146986496', 'login_customjs.zip', '', 'FS', 'logincustomjs', 'tenant_devcore_dev');
说明:
-- fisv字段值替换为对应客户的开发商标识,
-- fdcid字段值替换为对应环境的数据中心id,
-- ftenantid字段值替换为对应环境的租户id,
-- fkey字段值替换为"_tenant_login_config_{租户id}_loginpageattachfiles",如:_tenant_login_config_tenant_devcore_dev_loginpageattachfiles
(2)插入完sql之后,需要手动上传文件到静态资源文件目录
登录时扩展js上传路径:
../isv/{isv}/logincustomjs/,{isv}替换为对应客户的开发商标识,将上传的压缩文件在该目录下解压,解压时不要带压缩包文件名目录
3、登录页图片
步骤:
(1)在mc数据库中插入脚本,可修改图中三张图片数据,脚本需要根据环境做调整,说明如下
图片配置相关数据:
INSERT INTO t_mc_datasave
(FID, fkey, fvalue, fdcid, fvalue_tag)
VALUES(1133982885749981186, 'image_mcdata', '{"fileServerUrl":"tenantConfigImage038.zip","imageNames":["bgimg{tenantId}.webp","logoimg{tenantId}.webp","tabimg{tenantId}.webp"],"name":"tenantConfigImage038.zip","version":1679647568437,"url":"tenantConfigImage038.zip"}', 'tenant_devcore_dev', ' ');
说明:
fvalue字段值中imageNames内的{tenantId}替换为对应环境的租户id,如bgimgtenant_devcore_dev.webp,图片后缀按照实际图片扩展名修改(png,jpg等),插入的图片数据前缀,对应元数据的控件标识,其他图片名类似。
--"imageNames":["bgimg{tenantId}.webp","logoimg{tenantId}.webp","tabimg{tenantId}.webp"]
需要配置的图片,不需要的图片可以删除数组中的对应数据,如:
"imageNames":["bgimg{tenantId}.webp"]表示只配置背景图片
-- fdcid字段值替换为对应环境的租户id
INSERT INTO t_mc_datasave
(FID, fkey, fvalue, fdcid, fvalue_tag)
VALUES(1133982885749981187, '_tenant_login_config_values_', '{"lefttoplogoimg":"lefttoplogoimg.webp","hiddenresetpwd":"false","tabword":"[zh_TW=, zh_CN=]","bgimg":"bgimg.webp","accounttypedesc":"[zh_TW=, zh_CN=]","defaultusersourcetype":"2","linkdata":"[]","logoimg":"logoimg.webp","accountplaceholder":"[zh_TW=, zh_CN=]","usernamepsw":"2","showviewpwdbtn":"false","tabimg":"tabimg.webp","welcomemsg":"[zh_TW=, zh_CN=]"}', 'tenant_devcore_dev', ' ');
说明:
-- fdcid字段值替换为对应环境的租户id
图片路径和isv等配置数据:
INSERT INTO t_mc_web_client_files
(FID, fisv, fuploadtime, fupdateservertime, fenable, fneedupdate, fkey, fdcid, fname, ffileserverpath, fservertype, fdestpath, ftenantid)
VALUES(1478324783346089986, 'kingdee', '2022-08-02 16:47:27.0', NULL, '1', '1', '_tenant_login_config_tenant_devcore_dev_imagefile', '1402323749146986496', 'tenantConfigImage038.zip', '', 'FS', 'loginImage', 'tenant_devcore_dev');
说明:
-- fisv字段值替换为对应客户的开发商标识,
-- fdcid字段值替换为对应环境的数据中心id,
-- ftenantid字段值替换为对应环境的租户id,
-- fkey字段值替换为"_tenant_login_config_{租户id} _imagefile",如:_tenant_login_config_tenant_devcore_dev_imagefile
(2)插入完sql之后,需要手动上传文件到静态资源文件目录
图片上传路径:
../isv/{isv}/loginImage/,{isv}替换为对应客户的开发商标识,将图片按照t_mc_datasave 表中的fvalue字段值中imageNames数据对应命名:"imageNames":["bgimg{tenantId}.webp","logoimg{tenantId}.webp","tabimg{tenantId}.webp"],多个图片类似,最终图片路径
如:../isv/kingdee/loginImage/bgimg{tenantId}.webp
数据插入完成后,进入登录页配置查看是否显示相关数据,点击左上角保存按钮清空缓存,也可以直接清除reidis缓存:
清除redis缓存
key:mc-_tenant_login_config_values_{租户id}
如:mc-_tenant_login_config_values_tenant_devcore_dev
登录页配置通过脚本插入数据指导
本文2024-09-23 00:34:09发表“云苍穹知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-cangqiong-140300.html