refactor(store): 移除不必要的 type 变量声明
- 移除不必要的 type 变量声明 - 直接使用 $platform.uniPlatform 替代变量引用 - 保持代码逻辑不变但提高代码简洁性pull/174/head
parent
db95ed1a90
commit
0475d53d56
|
|
@ -182,11 +182,10 @@ const adaptTenant = async () => {
|
||||||
|
|
||||||
/** 初始化装修模版 */
|
/** 初始化装修模版 */
|
||||||
const adaptTemplate = async (appTemplate, templateId) => {
|
const adaptTemplate = async (appTemplate, templateId) => {
|
||||||
let type = $platform.uniPlatform;
|
|
||||||
const { data: diyTemplate } = templateId
|
const { data: diyTemplate } = templateId
|
||||||
? // 查询指定模板,一般是预览时使用
|
? // 查询指定模板,一般是预览时使用
|
||||||
await DiyApi.getDiyTemplate(templateId)
|
await DiyApi.getDiyTemplate(templateId)
|
||||||
: await DiyApi.getUsedDiyTemplate(type);
|
: await DiyApi.getUsedDiyTemplate($platform.uniPlatform);
|
||||||
// 模板不存在
|
// 模板不存在
|
||||||
if (!diyTemplate) {
|
if (!diyTemplate) {
|
||||||
$router.error('TemplateError');
|
$router.error('TemplateError');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue