GetSet.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. async function setMagicUrl(url) {
  2. localStorage.setItem('GoGoUrl',url);
  3. }
  4. // ture:开启使用魔法聊天|false:关闭使用魔法聊天|'repeat':开启聊天复用
  5. async function setChatHubWithMagic(user) {
  6. localStorage.setItem('ChatHubWithMagic',user);
  7. }
  8. // ture|false|'repeat'
  9. async function getChatHubWithMagic() {
  10. let v = localStorage.ChatHubWithMagic;
  11. if (v) {
  12. switch(v){
  13. case 0:
  14. break;
  15. case 1:
  16. return false;
  17. case 2:
  18. return true;
  19. }
  20. }
  21. return 'repeat';
  22. }
  23. //设置上次创建的聊天
  24. async function setLastChatJson(json) {
  25. localStorage.setItem('LastChatJson',json);
  26. }
  27. //获取上次创建的聊天
  28. async function getLastChatJson() {
  29. return localStorage.LastChatJson;
  30. }
  31. //获取上次聊天聊到的消息id次数
  32. async function getLastChatInvocationId(){
  33. return localStorage.LastChatInvocationId;
  34. }
  35. //设置上次聊天聊到的消息id次数
  36. async function setLastInvocationId(invocationId){
  37. return localStorage.setItem('LastChatInvocationId',invocationId);
  38. }