From 066729e8d9961957a18174b48ed9cc762626b972 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 29 Nov 2022 20:18:51 +0800 Subject: [PATCH] up --- plugins/gitea/js/gitea.js | 15 ++------------- scripts/getos.sh | 8 +++++++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/plugins/gitea/js/gitea.js b/plugins/gitea/js/gitea.js index 8f0a6071a..232518c53 100755 --- a/plugins/gitea/js/gitea.js +++ b/plugins/gitea/js/gitea.js @@ -1,19 +1,9 @@ -function str2Obj(str){ - var data = {}; - kv = str.split('&'); - for(i in kv){ - v = kv[i].split('='); - data[v[0]] = v[1]; - } - return data; -} - function gogsPost(method,args,callback, title){ var _args = null; if (typeof(args) == 'string'){ - _args = JSON.stringify(str2Obj(args)); + _args = JSON.stringify(toArrayObject(args)); } else { _args = JSON.stringify(args); } @@ -201,8 +191,7 @@ function userProjectList(user, search){ if(typeof(search) != 'undefined'){ req['search'] = search; } - - $('.layui-layer-close1').click(); + gogsPost('user_project_list', req, function(data){ var rdata = []; try { diff --git a/scripts/getos.sh b/scripts/getos.sh index 13f8af9d5..e9802f1ba 100755 --- a/scripts/getos.sh +++ b/scripts/getos.sh @@ -38,4 +38,10 @@ else OSNAME='unknow' fi -echo "$OSNAME" > /www/server/mdserver-web/data/osname.pl \ No newline at end of file +if [ -d /www/server/mdserver-web ];then + echo "$OSNAME" > /www/server/mdserver-web/data/osname.pl +fi + +if [ "$OSNAME" == "macos" ];then + echo "$OSNAME" +fi \ No newline at end of file