0元升级宝塔专业版免费专业版宝塔

最新资讯 加载中 113字 1784 度

1.jpeg

事先说明

宝塔专业版已经很便宜了,能支持的尽量支持正版。本篇文章我也只是做示范,会删除修改内容的

修改过程

1.我们按照目录打开下面的文件

/www/server/panel/class/panelPlugin.py

2.找到如下代码

#从云端取列表
def get_cloud_list(self,get=None):
    lcoalTmp = 'data/plugin.json'
    softList = None
    listTmp = public.readFile(lcoalTmp)
    try:
        if listTmp: softList = json.loads(listTmp)
    except:
        if os.path.exists(lcoalTmp): os.remove(lcoalTmp)

    focre  = 0
    if hasattr(get,'force'): focre = int(get.force)
    if 'focre_cloud' in session:
        if session['focre_cloud']:
            focre = 1
            session['focre_cloud'] = False

    if not 'init_cloud' in session:
            focre = 1
            session['init_cloud'] = True

    if not softList or focre > 0:
        self.clean_panel_log()
        cloudUrl = public.GetConfigValue('home') + '/api/panel/get_soft_list_test'
        import panelAuth
        pdata = panelAuth.panelAuth().create_serverid(None)
        listTmp = public.httpPost(cloudUrl,pdata,5)
        if not listTmp or len(listTmp) < 200:
            listTmp = public.readFile(lcoalTmp)
        try:
            softList = json.loads(listTmp)
        except: pass
        if softList: public.writeFile(lcoalTmp,json.dumps(softList))
        public.ExecShell('rm -f /tmp/bmac_*')
        self.getCloudPHPExt(get)
    try:
        public.writeFile("/tmp/" + cache.get('p_token'),str(softList['pro']))
    except:pass
    sType = 0
    try:
        if hasattr(get,'type'): sType = int(get['type'])
        if hasattr(get,'query'): 
            if get.query: sType = 0
    except:pass
    softList['list'] = self.get_local_plugin(softList['list'])
    softList['list'] = self.get_types(softList['list'],sType)
    if hasattr(get,'query'):
        if get.query:
            get.query = get.query.lower()
            tmpList = []
            for softInfo in softList['list']:
                if softInfo['name'].lower().find(get.query) != -1 or \
                    softInfo['title'].lower().find(get.query) != -1 or \
                    softInfo['ps'].lower().find(get.query) != -1: 
                    tmpList.append(softInfo)
            softList['list'] = tmpList
    return softList

3.我们在最下面的return softList上面加上以下内容,请注意缩进

softList['pro'] = 1
for soft in softList['list']:
    soft['endtime'] = 0

4.返回首页,在最上面的重启选择重启服务器即可

取消

感谢您的支持,我会继续努力哒!

扫码打赏,支付金额随意哦!

打开支付宝扫一扫,即可进行扫码打赏哦

我在今夏匆忙毕业了