12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- var prefix = 'jp_charging2_' + process.car.NODE_ENV+process.car.envjs + '_';
- var app = {
-
- getPrefix:()=> prefix,
- get : key => uni.getStorageSync(prefix + key),
- set : (key, value) => uni.setStorageSync(prefix + key, value),
- remove: key => uni.removeStorageSync(prefix + key),
- getPersonInfoPlus : (jp_identity) => {
- if(jp_identity){
- return uni.getStorageSync(prefix +jp_identity+ '_personInfoPlus')
- }else{
- return uni.getStorageSync(prefix + 'personInfoPlus')
- }
-
- },
- getPersonInfo : (jp_identity) => {
- if(jp_identity){
-
- return uni.getStorageSync(prefix +jp_identity+ '_personInfo')
-
- }else{
- return uni.getStorageSync(prefix + 'personInfo')
-
- }
-
- },
- signOut:()=> uni.removeStorageSync(prefix + 'personInfo'),
- getOpenId : () => uni.getStorageSync(prefix + 'wx_openId'+process.car.VUE_APP_WXAPPID),
- setOpenId: (value) => uni.setStorageSync(prefix + 'wx_openId'+process.car.VUE_APP_WXAPPID, value),
- setPersonInfo : (value,jp_identity) =>{
-
- if(jp_identity){
- uni.setStorageSync(prefix + jp_identity+'_personInfo', value)
-
- }else{
- uni.setStorageSync(prefix + 'personInfo', value)
-
- }
- },
- setPersonInfoPlus : (value,jp_identity) =>{
-
- if(jp_identity){
- uni.setStorageSync(prefix + jp_identity+'_personInfoPlus', value)
-
- }else{
- uni.setStorageSync(prefix + 'personInfoPlus', value)
-
- }
- },
- getToken : (options) => {
- //不同权限 ,不同token
- if(options&&options.jp_identity){
- return uni.getStorageSync(prefix+options.jp_identity+ '_token')
- }else{
- return uni.getStorageSync(prefix + 'token')
-
- }
- },
- setToken : (value,jp_identity) => {
- if(jp_identity){
- uni.setStorageSync(prefix +jp_identity + '_token', value)
- if(value){
- var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
- uni.setStorageSync(prefix + jp_identity+'_token_tdate', tdate)
- }
- }else{
- uni.setStorageSync(prefix + 'token', value)
- if(value){
- var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
- uni.setStorageSync(prefix + 'token_tdate', tdate)
- }
- }
-
-
- }
- ,
-
-
- }
- module.exports = app
|