Giter VIP home page Giter VIP logo

Comments (5)

zsxsoft avatar zsxsoft commented on May 26, 2024

请贴出你的完整代码吧?含import在内的。

from cordova-plugin-x5-tbs.

zoza23 avatar zoza23 commented on May 26, 2024

项目采用Cordova + Vue模式,demo如下:

<template>
  <div id="swiper">
    <div><button @click="setCookies">set cookie</button></div>
    <div><button @click="showCookies">show cookie</button></div>
    <div><button @click="clearCookie">clear cookie</button></div>
  </div>
</template>

<script>
  import {cookie} from 'vux'
  export default {
    name: 'Swiper',
    data: function () {
      return {}
    },
    methods: {
      setCookies () {
        cookie.set('cookie', 'this is my cookie', {path: '/'})
      },

      showCookies () {
        alert(cookie.get('cookie', {path: '/'}))
      },

      clearCookie () {
        cookie.remove('cookie', {path: '/'})
      }
    }
  }
</script>

<style lang="less" scoped>
  #swiper {
    height: 100%;
    text-align: center;
    &>div {padding-top: 50px;}
    button {
      display: block;
      margin: 0 auto;
      padding: 5px 10px;
      border-radius: 4px;
      background-color: burlywood;
    }
  }
</style>

from cordova-plugin-x5-tbs.

zsxsoft avatar zsxsoft commented on May 26, 2024

https://github.com/zsxsoft/cordova-plugin-x5-tbs/blob/master/platforms/android/src/com/zsxsoft/cordova/x5/X5CookieManager.java#L42

把这行的注释去掉看看
直接改你的cordova/platforms/android下面的文件

from cordova-plugin-x5-tbs.

zoza23 avatar zoza23 commented on May 26, 2024

解开注释后编译不通过,报错信息提示找不到符号,估计是SDK没有提供setAcceptFileSchemeCookies这个方法。
2019-01-07 5 10 57

from cordova-plugin-x5-tbs.

zsxsoft avatar zsxsoft commented on May 26, 2024

那这样的话,应该是只有http / https能使用Cookie了,不让在本地使用Cookie。

from cordova-plugin-x5-tbs.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.