xctc-utils 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/weixin/index.d.ts +1 -0
- package/dist/weixin/index.js +13 -6
- package/package.json +1 -1
    
        package/dist/weixin/index.d.ts
    CHANGED
    
    
    
        package/dist/weixin/index.js
    CHANGED
    
    | @@ -105,18 +105,25 @@ function weixinLogin(code) { | |
| 105 105 | 
             
                if (!http)
         | 
| 106 106 | 
             
                    return;
         | 
| 107 107 | 
             
                (0, index_1.useSessionStorage)("weixinLoginParams", JSON.stringify(obj));
         | 
| 108 | 
            +
                if (weixinConfig === null || weixinConfig === void 0 ? void 0 : weixinConfig.isPassLogin)
         | 
| 109 | 
            +
                    return;
         | 
| 108 110 | 
             
                weixinConfig.http(obj).then(function (res) {
         | 
| 109 111 | 
             
                    if (res.code == 40163) {
         | 
| 110 112 | 
             
                        // 未登录则先执行登录
         | 
| 111 113 | 
             
                        return weixinCode();
         | 
| 112 114 | 
             
                    }
         | 
| 113 115 | 
             
                    var data = res === null || res === void 0 ? void 0 : res.data;
         | 
| 114 | 
            -
                    if  | 
| 115 | 
            -
             | 
| 116 | 
            -
                    }
         | 
| 117 | 
            -
                     | 
| 118 | 
            -
             | 
| 119 | 
            -
                     | 
| 116 | 
            +
                    // if( data instanceof Object  ){
         | 
| 117 | 
            +
                    //     useSessionStorage( "weixinLoginData" , JSON.stringify(data) )
         | 
| 118 | 
            +
                    // }else{
         | 
| 119 | 
            +
                    //     useSessionStorage( "weixinLoginStatus" , `微信登录失败:${res.code};${res.msg}` )
         | 
| 120 | 
            +
                    // }
         | 
| 121 | 
            +
                    var resobj = {
         | 
| 122 | 
            +
                        code: res.code,
         | 
| 123 | 
            +
                        msg: res.msg,
         | 
| 124 | 
            +
                        data: res.data
         | 
| 125 | 
            +
                    };
         | 
| 126 | 
            +
                    (0, index_1.useSessionStorage)("weixinLoginData", JSON.stringify(resobj));
         | 
| 120 127 | 
             
                    for (var key in data) {
         | 
| 121 128 | 
             
                        var item = data[key];
         | 
| 122 129 | 
             
                        if (item instanceof Object) {
         | 
    
        package/package.json
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            {
         | 
| 2 2 | 
             
              "name": "xctc-utils",
         | 
| 3 | 
            -
              "version": "1.2. | 
| 3 | 
            +
              "version": "1.2.2",
         | 
| 4 4 | 
             
              "description": "localStorage存储\r ```\r sessionStorage存储\r ```\r crypto-js加密、解密\r ```\r 微信授权登录、微信分享\r ```\r 设备环境获取\r ```\r 是否是微信浏览器\r ```\r 时间戳转时间,字符串转时间戳",
         | 
| 5 5 | 
             
              "main": "./dist/index.js",
         | 
| 6 6 | 
             
              "types": "./dist/index.d.ts",
         |