- 添加项目配置文件(.editorconfig, .gitignore) - 创建App.vue主应用文件,包含启动时Mock数据初始化 - 添加index.html和main.js应用入口文件 - 配置manifest.json应用基本信息和权限设置 - 设置pages.json页面路由和全局样式 - 添加uni.promisify.adaptor.js适配器文件 - 创建uni.scss设计令牌系统,定义琥珀夜光主题色彩 - 新增constants.js常量定义,包含酒类分类和品牌数据
15 lines
348 B
JavaScript
15 lines
348 B
JavaScript
uni.addInterceptor({
|
|
returnValue(res) {
|
|
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then ===
|
|
"function")) {
|
|
return res;
|
|
}
|
|
return new Promise((resolve, reject) => {
|
|
res.then((res) => {
|
|
if (!res) return resolve(res)
|
|
return res[0] ? reject(res[0]) : resolve(res[1])
|
|
});
|
|
});
|
|
},
|
|
});
|