You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
692 B
37 lines
692 B
const install = (Vue,vm) => {
|
|
// 挂载到$u 上
|
|
vm.$u.utils = {
|
|
|
|
//设置本地数据缓存
|
|
setSystemCacheData:(userKeyVal,tokenVal,userNameVal,myPwdVal)=>{
|
|
console.log('接口返回--缓存设置-1---',userKeyVal,tokenVal);
|
|
let _this=this
|
|
let tokenTimeVal=new Date().getTime()
|
|
let returnData = 0
|
|
uni.setStorage({
|
|
key: 'myCache',
|
|
data: {
|
|
tokenTime:tokenTimeVal,
|
|
userKey:userKeyVal,
|
|
token:tokenVal,
|
|
userName:userNameVal,
|
|
myPwd:myPwdVal
|
|
},
|
|
success: function () {
|
|
returnData = 1111
|
|
},
|
|
fail() {
|
|
returnData = 2222
|
|
}
|
|
});
|
|
return returnData
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
//抛出入口
|
|
export default {
|
|
install
|
|
}
|