@onbright/oui
Advanced tools
Comparing version 1.0.5 to 1.1.0
30
index.js
@@ -8,2 +8,4 @@ // 引入全局mixin | ||
// 尝试判断在根目录的/store中是否有$o.mixin.js,此文件oui默认为需要挂在到全局的vuex的state变量 | ||
@@ -51,3 +53,6 @@ // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式, | ||
import toast from './libs/function/toast.js' | ||
import { loading, hideLoading } from './libs/function/loading.js' | ||
import { | ||
loading, | ||
hideLoading | ||
} from './libs/function/loading.js' | ||
// 获取父组件参数 | ||
@@ -60,10 +65,18 @@ import getParent from './libs/function/getParent.js' | ||
// 同时把安卓和ios平台的名称"ios"和"android"挂到$o.os()中,方便取用 | ||
import { sys, os } from './libs/function/sys.js' | ||
import { | ||
sys, | ||
os | ||
} from './libs/function/sys.js' | ||
// 防抖方法 | ||
import debounce from './libs/function/debounce.js' | ||
// 节流方法 | ||
import throttle, { throttleContext } from './libs/function/throttle.js' | ||
import throttle, { | ||
throttleContext | ||
} from './libs/function/throttle.js' | ||
// 缓存 | ||
import storage from './libs/function/storage.js' | ||
// 操作token | ||
import auth from './libs/function/auth.js' | ||
// 配置信息 | ||
@@ -74,3 +87,3 @@ import config from './libs/config/config.js' | ||
function wranning (str) { | ||
function wranning(str) { | ||
// 开发环境进行信息输出,主要是一些报错信息 | ||
@@ -84,2 +97,3 @@ // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见: | ||
export const $o = { | ||
@@ -117,3 +131,4 @@ queryParams: queryParams, | ||
toast, | ||
loading, hideLoading, | ||
loading, | ||
hideLoading, | ||
config, // oui配置信息相关,比如版本号 | ||
@@ -124,3 +139,4 @@ zIndex, | ||
throttleContext, | ||
storage | ||
storage, | ||
auth | ||
} | ||
@@ -153,2 +169,2 @@ | ||
install | ||
} | ||
} |
@@ -8,2 +8,3 @@ import deepMerge from "../function/deepMerge"; | ||
this.config = deepMerge(this.config, customConfig); | ||
} | ||
@@ -19,3 +20,3 @@ | ||
// 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调 | ||
return new Promise(()=>{}); | ||
return new Promise(() => {}); | ||
} | ||
@@ -39,3 +40,3 @@ this.options = interceptorRequest; | ||
// 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data | ||
if(this.config.originalData) { | ||
if (this.config.originalData) { | ||
// 判断是否存在拦截器 | ||
@@ -83,7 +84,7 @@ if (this.interceptor.response && typeof this.interceptor.response === 'function') { | ||
options.url : '/' + options.url)); | ||
// 是否显示loading | ||
// 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id | ||
// 而没有清除前者的定时器,导致前者超时,一直显示loading | ||
if(this.config.showLoading && !this.config.timer) { | ||
if (this.config.showLoading && !this.config.timer) { | ||
this.config.timer = setTimeout(() => { | ||
@@ -123,3 +124,3 @@ uni.showLoading({ | ||
} | ||
// 拦截器 | ||
@@ -152,3 +153,3 @@ this.interceptor = { | ||
} | ||
// put请求,不支持支付宝小程序(HX2.6.15) | ||
@@ -163,3 +164,3 @@ this.put = (url, data = {}, header = {}) => { | ||
} | ||
// delete请求,不支持支付宝和头条小程序(HX2.6.15) | ||
@@ -176,2 +177,2 @@ this.delete = (url, data = {}, header = {}) => { | ||
} | ||
export default new Request | ||
export default new Request |
{ | ||
"name": "@onbright/oui", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "oui UI,是uni-app的UI框架", | ||
"main": "index.js", | ||
"keywords": [], | ||
"keywords": [ | ||
"oui" | ||
], | ||
"scripts": { | ||
@@ -8,0 +10,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1089928
163
5809
0