江湖艺人
江湖艺人
  • 发布:2024-08-05 18:04
  • 更新:2024-09-13 09:49
  • 阅读:105

renderjs模块中无法获取cookie

分类:uni-app

uniapp开发uni小程序时需要使用renderjs引入第三方网站,可以在renderjs中无法设置和获取cookie?

这是bug还是需要怎么操作才能获取到cookie???

2024-08-05 18:04 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

给一下你的代码,帮你看一下

  • 江湖艺人 (作者)

    运行到app端或 uni小程序sdk发到手机app端都获取不到

    <template>

    <view class="content">

    <image class="logo" src="/static/logo.png"></image>

    <view class="text-area">

    <text class="title">{{title}}</text>

    </view>

    </view>

    </template>


    <script>

    export default {

    data() {

    return {

    title: 'Hello'

    }

    },

    }

    </script>


    <script module="customPage" lang="renderjs">

    export default {

    mounted(){

    document.cookie="张三"

    console.log("document.cookie",document.cookie);

    }

    }

    </script>

    2024-08-06 10:17

江湖艺人

江湖艺人 (作者)

//运行到app端或 uni小程序sdk发到手机app端都获取不到  
<template>  
    <view class="content">  
        <image class="logo" src="/static/logo.png"></image>  
        <view class="text-area">  
            <text class="title">{{title}}</text>  
        </view>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                title: 'Hello'  
            }  
        },  
    }  
</script>  

<script module="customPage" lang="renderjs">  
     export default {  
        mounted(){  
            document.cookie="张三"  
            console.log("document.cookie",document.cookie);  
        }  
    }  
</script>
江湖艺人

江湖艺人 (作者)

//运行到app端或 uni小程序sdk发到手机app端都获取不到  
<template>  
    <view class="content">  
        <image class="logo" src="/static/logo.png"></image>  
        <view class="text-area">  
            <text class="title">{{title}}</text>  
        </view>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                title: 'Hello'  
            }  
        },  
    }  
</script>  

<script module="customPage" lang="renderjs">  
     export default {  
        mounted(){  
            document.cookie="张三"  
            console.log("document.cookie",document.cookie);  
        }  
    }  
</script>
DCloud_UNI_yuhe

DCloud_UNI_yuhe

小程序不支持

  • 江湖艺人 (作者)

    但是app中使用renderjs应该支持的,为啥也不行?

    2024-08-06 11:01

1***@qq.com

1***@qq.com

同问 app中 renderjs 也不行呢?

要回复问题请先登录注册