From 07627e0648681afd13a290feeda88289bb26832e Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 3 Aug 2024 17:29:13 +0800 Subject: [PATCH] bugfix --- files/README.md | 0 i18n/README.md | 0 logs/README.md | 0 plugins/README.md | 15 ----- plugins/__pycache__/auth.cpython-310.pyc | Bin 467 -> 0 bytes plugins/__pycache__/plugin.cpython-310.pyc | Bin 2543 -> 0 bytes .../__pycache__/wechat_agent.cpython-310.pyc | Bin 551 -> 0 bytes plugins/auth.py | 9 --- plugins/plugin.py | 56 ------------------ plugins/wechat_agent.py | 11 ---- wwwroot/README.md | 0 11 files changed, 91 deletions(-) create mode 100644 files/README.md create mode 100644 i18n/README.md create mode 100644 logs/README.md delete mode 100644 plugins/__pycache__/auth.cpython-310.pyc delete mode 100644 plugins/__pycache__/plugin.cpython-310.pyc delete mode 100644 plugins/__pycache__/wechat_agent.cpython-310.pyc delete mode 100644 plugins/auth.py delete mode 100644 plugins/plugin.py delete mode 100644 plugins/wechat_agent.py create mode 100644 wwwroot/README.md diff --git a/files/README.md b/files/README.md new file mode 100644 index 0000000..e69de29 diff --git a/i18n/README.md b/i18n/README.md new file mode 100644 index 0000000..e69de29 diff --git a/logs/README.md b/logs/README.md new file mode 100644 index 0000000..e69de29 diff --git a/plugins/README.md b/plugins/README.md index fcda301..e69de29 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -1,15 +0,0 @@ -# 大模型公司账号信息 - -## 商汤 -### 开元云账号 -用户名:kyycloud -密码:Kyy123456@ -_VaV5trl8faujgr7xaE3D -调试用Bearer令牌 apikey= -eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzpoeWRyYS5qd3QuYWNjZXNzLXRva2VuIiwidHlwIjoiSldUIn0.eyJhdWQiOltdLCJjbGllbnRfaWQiOiI0ZTQxNDg1NC03MjAwLTUwOWYtYjk2MC1mOGIwZGJiYmYzMzEiLCJleHAiOjE3MjE3Mzc5MTYsImV4dCI6eyJhbGxfYXoiOmZhbHNlL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2YjgyLWY1ZjktNGYyOC05OGJkLTc4ZjNiZGRmOTIxNyIsIm5iZiI6MTcyMTcyNzExNiwic2NwIjpbIm9wZW5pZCIsIm9mZmxpbmUiLCJvZmZsaW5lX2FjY2VzcyJdLCJzdWIiOiJreXljbG91ZDowOTVjOGRhZS1lYjAzLTQ0YmEtYjdkOS00M2QxOWYxNzJhMWI6NTM1ZmNlNjYtM2VlOC00ZDdhLTk3OWEtNjVlNDQzMGFmNTRiIn0.rdsmjM2kqendUdycvmSc11xJ2t8rMy2H6QrMpOOInvIWj56WJxnpj3-4aGw7SE7MQm4hw9OxAOP3JVwQKfqCz16PUmjtc8ue61vHKJw2aXtOjuv5Hb1u3HLPhN7gsflDj80KV7Ga0QD4V6XYKN9cb-MRwsLrmJLYay2oyqpX3iNyZR3z5O07CEbCVE0MDDIjxt7EyhpkfpSPKTWbnbJaOW73pdJZq6Q5xzxRvKOdywVq1-5Ifem8NyvMPqFnjc1kGVJbmD13hktC6d-R3EfoqzBz-QutGKQdhZoTj1Bo6g6imIXzAcCNbRFNU7fU5Vn8-AkdqtpY0Nhd-CCnQNIvX2ngvA08WxKV4nt9VGouuSCrbvZ8LrtiyPx3Ays3F8fUdefH91WD28YRytzfA1SrAogMfZz7zX-pKulB0erHfoveRqbY4wjDiY8lYRARVmd0d_RVNE7q6ArilvgSOo-oiJI-VQYeFse16xuUcYnvhQjNR6fSW1vARiEvztMOhF1lwPhikcXggqY7-XEklsgot3Qi402kXPu8r9WEfjdlrcY3I8eaGfRew2i4PrwKEZulgwuU7LC1VQufdQDGKxS8X_vQntHMwe1b-3s0RZ8qpMcWB6mNXSB8T6ghT2N0taCkKTc6Oe_O322Y9lLWqLXAYC96cU9eoaIyC0jXNPp9tbE - -AccessKey ID: A13ECA33C26F4B20AB283ADB11159792 AccessKey Secret:D3843572206F4701BB779949C89F7576 -以下是个人注册的 -AccessKey ID: 69DDB0B8B4D443A589F8E0AEF70CE29C AccessKey Secret:C7699DC1E8904B3189959942EFB8918B diff --git a/plugins/__pycache__/auth.cpython-310.pyc b/plugins/__pycache__/auth.cpython-310.pyc deleted file mode 100644 index f76b50d46d5e8cbd43f039f00ad3a11169bac630..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 467 zcmZuuu};G<5VaF0Ep0O(P$z`KMwVn_KnPL9!cs*7mMm48xJ`spyLN)qssjjSegN?S z{SN-ZD-*u}3+IZV11H_--P!lJv?U9?iHz;U*K`&ZkP0HDX2UxcTOX2XKBW+>; diff --git a/plugins/__pycache__/plugin.cpython-310.pyc b/plugins/__pycache__/plugin.cpython-310.pyc deleted file mode 100644 index c2a9b3478a1df46990510ad213d14f35853753a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2543 zcmZuzTW{mm5hkg-*1K(XolUyU1_oNR@PlmeCW&ZMRI+SYvL)HpT?n8a@*GOMQzUhT zx7fz%cV>n&=M3kg^Ym$!g6p5fko!U#7WUHDI zv}K(r!MAU(X(~)2S2M^ad_val#3zblV_#t+-G?g)eH7FQJpO0UY%{miSK#{B^ry@l z=1pus+3&@vfZn{KsW;&EHWAR6xsBg3pV1hQKgL(|in?V2CWr;`ui{@ri2KwXeMjHY z(dYx}e^+q)%h;PlkkFI2iQ5=Xz@5aYFBzPE7l+_7t&l$2KGW~Bo-W`pfKfK`upjD9Ef7E>+kR~86ACV6L=>ziN zBl0sq{s71;{BxX&><0|~=$8J1!LM(rFPOi??`WC|s5=Vs<>OYEnrp~j5qtX!-^eLQ z#43@+5*8#uVCDwsmLPH7a9o(RJ3N@)DBk-eBfF6{76Sf^B8CKsM5L zKB=s#paRc>XFP{lUdc-ZBB~rIawU$%a+t=1xIQ7qP8<~whee_wRxS#xBugNwa0OoB z3!F??NHt5dH4ClLU*V+5rZJOiiq_T|9q^8AX?4GD--yady-+vYVgIBd9f8ofVo9uW zD$e9VFA@%9{>+svWlDxU?ee72SGfMBYn=t-4k%jeQW=*p2aWl7(8_muJ8a$Bj)YdX$+z@twq0#*TGc6x%bU8k(t5SoQnsS^*4NGLbk*#Z z*R5_{Y(~x+cq8-u)&I9s7n-`UX?L5edpl?Lxc5U0J3m^Zf$7(E2fSKo*L=eq4R6eT z&Ag98udkZ=bJgCy z^#-kGIdeouT4l&eq#=!<;0Eq97EJ z93CL3BZ?rENFEghJ`dGE$rmukVFjxy$MW06!YAG*+t&xS6CBLYk~|RTf$DhC&_)*d za$4!dt&gKYR>N`i@LT9asTa?i@IB6{JVVcw=A zeq!RlNXhTh42*a4J?Nj^kE8hmw$CJKPXIM2#qp@y3uFGq51*qM*oNPkqx+87OD|%w za384iY9X7Na)cj$aqdHSAJ)B>kx7Yx0Zt!Cixu= XkpCQ-G_^-Z&Zg;oCjBD$I!pftv_RiD diff --git a/plugins/__pycache__/wechat_agent.cpython-310.pyc b/plugins/__pycache__/wechat_agent.cpython-310.pyc deleted file mode 100644 index 5e1b7f884ca4e0a0bfd4e35296992102b8c5028a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 551 zcmZ8f&2GXl3{KKg(gG8jc!o*6&=;7dX+PR&3~9GsP}+o2NNGt62#MQv-COL!3+!QX z-D$6|%jT4gp*gbs*^R&0R`X8BLm>BWuj3pe^lpMs6*ge%7$X?q*Xj&m2T8`l>@mQQY~{gbE}nowC97K#b>zElUG-%>6(-DO2FTt+gD`|DiIgi>Z0 z-TO=P!#b4p?~|EezngvIr)*LRwGyhI{O(Daz0@yioYXTMnYQ7h=UL8|Qe40ffXXfy NirRR8C~+(ge*=H|hDiVb diff --git a/plugins/auth.py b/plugins/auth.py deleted file mode 100644 index 8fbdebe..0000000 --- a/plugins/auth.py +++ /dev/null @@ -1,9 +0,0 @@ -from appPublic.log import info -from ahserver.auth_api import AuthAPI -from sqlor.dbpools import DBPools - -async def checkUserPermission(self, user, path): - info(f'checkUserPermission():{user} access to {path} ..') - return True - -AuthAPI.checkUserPermission = checkUserPermission diff --git a/plugins/plugin.py b/plugins/plugin.py deleted file mode 100644 index ff7b9c1..0000000 --- a/plugins/plugin.py +++ /dev/null @@ -1,56 +0,0 @@ -import sys -from ahserver.serverenv import ServerEnv -from appPublic.dictObject import DictObject -import time -import jwt - -def generate_zhipuai_token(apikey: str, exp_seconds: int=86400): - try: - id, secret = apikey.split(".") - except Exception as e: - raise Exception("invalid apikey", e) - - payload = { - "api_key": id, - "exp": int(round(time.time() * 1000)) + exp_seconds * 1000, - "timestamp": int(round(time.time() * 1000)), - } - - return jwt.encode( - payload, - secret, - algorithm="HS256", - headers={"alg": "HS256", "sign_type": "SIGN"}, - ) - -async def get_llm_user_apikey(apiname, user): - if apiname == 'qianwen': - return DictObject(apikey='sk-ca5dfeb58d494f32a9cf1e9f064370c8') - - if apiname=='baiduqianfan': - return DictObject(apikey='SjAN4GHU07LuB8ZYOIstB31G', - secretkey='QbakADoGJsM2qjUzIogTkBZruToxYAve') - if apiname=='baichuanai': - return DictObject(apikey='sk-f1fca6335df32d13c096e5f2e72821db') - if apiname=='deepseek': - return DictObject(apikey='sk-a6a2d5eca1b7419b95f2c263c362be1e') - - if apiname == 'minimax': - return DictObject(apikey='eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJHcm91cE5hbWUiOiJtb3FpbmcgeXUiLCJVc2VyTmFtZSI6Im1vcWluZyB5dSIsIkFjY291bnQiOiIiLCJTdWJqZWN0SUQiOiIxNzY4NTM3NjQ1ODMyNDg3NjAyIiwiUGhvbmUiOiIxMzgwMTAxNTI5MiIsIkdyb3VwSUQiOiIxNzY4NTM3NjQ1ODI4MjkyOTMwIiwiUGFnZU5hbWUiOiIiLCJNYWlsIjoiIiwiQ3JlYXRlVGltZSI6IjIwMjQtMDQtMTAgMTg6MDA6NTMiLCJpc3MiOiJtaW5pbWF4In0.VaRRHr9XMUSYhZOKVS2PRZv6Y9VCaW4JX2ks4QZX3aFr_emjnDbGv5HfNskf54piflEAeTMW4Qw1nG7bqhYea7N5LKHGf0YpesPGSoqxwyZUR4oaJNNVUsSe6eiLbdYSDO2wMb_hV5xyawh-lYe1reBKWaPVuOjfTrDhxzA0IBmzl-jAQhL8-kIZet2uX-p3NjxElpo_zjmVV_hA1BJEvTwuAk8ka-1SBZmXciMhBi1fJG4jcqoHCCN_JHJ7pgjKr5bk2Zw5qCqiU2Ecsc-kPIEK1SI5EYoLszT43UpJ8_wV4Pm07UBCn3vktAa0fjKDSUArPkBoYWSkgKDMWlmxig', groupid='1768537645828292930') - if apiname == 'zhipuai': - return DictObject(token=generate_zhipuai_token('ffd0affcb6b5f9368f517c09c75a6817.jp9DdpcgwdxXvDiT')) - if apiname == 'moonshot': - return DictObject(apikey='sk-fHOyIKC2mlIDfGwUQV6SwjwVJkjBJgkNWYv82yt3OdpYh592') - if apiname == 'openai': - return DictObject(apikey='sk-proj-gFbYlxVnhmfqf8MXhX42T3BlbkFJprO7jXabkwtjmrNeH77Z') - if apiname == 'doubao': - return DictObject(apikey='a2fddeaa-c31c-4cbe-aacb-732318408dac') - - if apiname == 'tianqi': - return DictObject(apikey='94b72c37e62e49f796502d29955447ab', secretkey='afcac498e0a74302bec06d22dcdff213') - - print(f'{user=} not have apikey for {apiname=}') - return DictObject() - -g = ServerEnv() -g.get_llm_user_apikey = get_llm_user_apikey diff --git a/plugins/wechat_agent.py b/plugins/wechat_agent.py deleted file mode 100644 index 7c0be83..0000000 --- a/plugins/wechat_agent.py +++ /dev/null @@ -1,11 +0,0 @@ -import itchat -from appPublic.worker import awaitify -from appPublic.dictObject import DictObject -from appPublic.background import Background -from ahserver.globalEnv import GlobalEnv - -def wechat_login(login_callback, qr_callback): - Background(itchat.login, login_callback=login_callback, - qr_callback=qr_callback) -g = GlobalEnv() -g.wechat_login = wechat_login diff --git a/wwwroot/README.md b/wwwroot/README.md new file mode 100644 index 0000000..e69de29