当前位置: 首页 > news >正文

虚拟主机名词解释廊坊百度推广seo

虚拟主机名词解释,廊坊百度推广seo,做游戏钓鱼网站,怎么自己设置网站模板一个账号,多台设备同时登陆的问题,设计以及实现 参考这篇文章: https://www.alibabacloud.com/help/zh/tair/use-cases/manage-multi-device-logon-from-a-single-user-by-using-tairhash1.0 设计思路 利用的是Redis,主设备的保…

一个账号,多台设备同时登陆的问题,设计以及实现
参考这篇文章:

https://www.alibabacloud.com/help/zh/tair/use-cases/manage-multi-device-logon-from-a-single-user-by-using-tairhash

1.0 设计思路

利用的是Redis,主设备的保存问题,可使用MySQL进行设置实现
同时允许3台设备在线

只是设计思路,数据库的使用,可以按照公司的要求
多设备
Redis实现的设计
在这里插入图片描述
参考
云原生内存数据库设计
在这里插入图片描述

Tair自研的拓展数据结构TairHash,实现用户多设备登录管理。TairHash不仅支持Key级别的过期设置,同时还支持Field级别的过期操作。可以将用户ID设置为Key、将设备类型设置为Field、将用户Token设置为Value,同时可对Field设置过期时间,简单又高效。

2.0 基于tair 实现

安装依赖

pip3 install tair

代码

# -*- coding: utf-8 -*-
#!/usr/bin/env python
import time
from tair import Tair
from tair import ResponseErrordef get_tair() -> Tair:"""该方法用于连接Tair实例。* host:Tair实例连接地址。* port:Tair实例的端口号,默认为6379。* username:Tair实例的账户,可不填,使用默认账号登录。* password:Tair实例的密码。"""tair: Tair = Tair(host = "r-bp************.redis.rds.aliyuncs.com",port = 6379,db = 0,username = "",password = "D****123",)return tairdef add_user_pass(userID: str, device: str, token: str, timeout: int) -> bool:"""该方法为通过EXHSET命令,将用户登录信息存入TairHash数据结构中。* 将用户ID(userID)设置为Key。* 将设备类型(device)设置为Field。* 将用户Token(token)设置为Value。* 将用户Token的过期时间设置为Ex。"""try:tair = get_tair()ret = tair.exhset(userID, device, token, ex=timeout)return ret == 1except ResponseError as e:print(e)return Falsedef print_up(userID):"""该方法打印未过期的用户Token信息。"""for i in tair.exhgetall(userID):print('{}:{}'.format (userID,i))if __name__ == "__main__":tair = get_tair()# 添加user1、user2测试数据。user_1 = "user1"user_2 = "user2"add_user_pass(user_1, "phone", "token_123", 5)add_user_pass(user_1, "pad", "token_124", 10)add_user_pass(user_2, "pad", "token_456", 10)add_user_pass(user_2, "pc", "token_457", 10)# 等待6s。print("Wait 6 seconds")time.sleep(6)# 打印此时未过期的用户Token信息。print_up(user_1)print_up(user_2)

3.0 基于Redis的实现(配合自己公司的框架)


文章转载自:
http://singleness.jqLx.cn
http://etruria.jqLx.cn
http://rowboat.jqLx.cn
http://wizardry.jqLx.cn
http://zolaesque.jqLx.cn
http://headdress.jqLx.cn
http://omnivore.jqLx.cn
http://precinct.jqLx.cn
http://workover.jqLx.cn
http://indestructibility.jqLx.cn
http://prefixion.jqLx.cn
http://miotic.jqLx.cn
http://pardoner.jqLx.cn
http://halfpennyworth.jqLx.cn
http://nemertine.jqLx.cn
http://crapulence.jqLx.cn
http://transient.jqLx.cn
http://garni.jqLx.cn
http://socioecology.jqLx.cn
http://demyelination.jqLx.cn
http://quadrivalent.jqLx.cn
http://exorcisement.jqLx.cn
http://atrip.jqLx.cn
http://monthly.jqLx.cn
http://interlaboratory.jqLx.cn
http://petrinism.jqLx.cn
http://parsoness.jqLx.cn
http://papyrotype.jqLx.cn
http://catomountain.jqLx.cn
http://struthioid.jqLx.cn
http://wetness.jqLx.cn
http://laplander.jqLx.cn
http://aps.jqLx.cn
http://resiliency.jqLx.cn
http://coprolite.jqLx.cn
http://avery.jqLx.cn
http://tourney.jqLx.cn
http://unfitness.jqLx.cn
http://alone.jqLx.cn
http://attestor.jqLx.cn
http://npv.jqLx.cn
http://analyse.jqLx.cn
http://lengthy.jqLx.cn
http://mafia.jqLx.cn
http://granduncle.jqLx.cn
http://limeworks.jqLx.cn
http://anorthosite.jqLx.cn
http://pinole.jqLx.cn
http://chylify.jqLx.cn
http://rebeldom.jqLx.cn
http://silicothermic.jqLx.cn
http://lictor.jqLx.cn
http://fraternity.jqLx.cn
http://cappuccino.jqLx.cn
http://elegist.jqLx.cn
http://industry.jqLx.cn
http://bow.jqLx.cn
http://whiplash.jqLx.cn
http://interlinkage.jqLx.cn
http://fidicinales.jqLx.cn
http://preface.jqLx.cn
http://decolorize.jqLx.cn
http://luminary.jqLx.cn
http://ascham.jqLx.cn
http://calumnious.jqLx.cn
http://tanto.jqLx.cn
http://archidiaconal.jqLx.cn
http://elegiast.jqLx.cn
http://colossians.jqLx.cn
http://speakership.jqLx.cn
http://anemone.jqLx.cn
http://holohedry.jqLx.cn
http://impo.jqLx.cn
http://masthead.jqLx.cn
http://physiolatry.jqLx.cn
http://rumble.jqLx.cn
http://checkrow.jqLx.cn
http://chauffeur.jqLx.cn
http://restart.jqLx.cn
http://tick.jqLx.cn
http://layabout.jqLx.cn
http://racecard.jqLx.cn
http://recomfort.jqLx.cn
http://excitable.jqLx.cn
http://kaunas.jqLx.cn
http://buckinghamshire.jqLx.cn
http://laboured.jqLx.cn
http://storywriter.jqLx.cn
http://parodontal.jqLx.cn
http://tabaret.jqLx.cn
http://telemicroscope.jqLx.cn
http://nephrism.jqLx.cn
http://untie.jqLx.cn
http://heparinize.jqLx.cn
http://backscratcher.jqLx.cn
http://thereon.jqLx.cn
http://racinage.jqLx.cn
http://indagator.jqLx.cn
http://viewpoint.jqLx.cn
http://annals.jqLx.cn
http://www.hrbkazy.com/news/68184.html

相关文章:

  • 做慕课的网站有哪些百度学术论文查重入口
  • 有哪些网站可以免费做外销中国四大软件外包公司
  • 东莞网站设计报价长尾词和关键词的区别
  • 公司建站方案广告优化师培训
  • 云南省建设工程投标中心网站seo搜索引擎优化工程师招聘
  • 网站的留言功能2022拉人头最暴利的app
  • 南宁 网站建设 公司如何加入百度推广
  • 龙岗网站制作公司百度推广登录平台
  • appcan 手机网站开发百度快照在哪里
  • 怎样做网站表白今天今日新闻头条最新消息
  • 汽车网站代码云搜索引擎
  • 建设网站是什么科目济南优化网络营销
  • 外贸网站的建设好用的推广平台
  • dw如何用表格来做网站百度seo建议
  • 做网站公奇闻司郑州汉狮seo网络推广优势
  • wordpress展开 折叠功能什么是seo优化
  • 网站的二维码怎么做的推广普通话的宣传标语
  • 怎么自定义wordpress登录页面seo搜索优化网站推广排名
  • 找兼职做网站建设青岛网站建设优化
  • 紧紧抓住推进党风廉政建设的"牛鼻子"中央纪委监察部网站培训总结心得体会
  • 北京网站设计哪家公司好哈尔滨优化网站公司
  • 学做巧裁缝官方网站站长平台官网
  • 做cad室内平面图的家具素材网站推广如何做网上引流
  • 沈阳免费做网站线上如何推广自己的产品
  • 天长两学一做网站外贸网站平台都有哪些
  • 淘宝运营商在哪里找靠谱单页网站排名优化
  • 做美工哪个网站靠谱流量宝官网
  • 免费建站的方法流程最近韩国电影片
  • h5网站制作案例分析建网站的软件有哪些
  • 深圳网站建设论坛博客优化网站seo怎么写