成人黄网站A片免费观看,欧美人妻少妇精品久久黑人,国产内射999视频一区,国产成年女人毛片80S网站

Section Menu:  

添加管理員函數(shù):update()

  • 發(fā)布時(shí)間: 2019-08-28 00:00
  •    閱讀: 2524   

描述

update() 通過(guò)傳入的參數(shù)創(chuàng)建或修改管理員用戶。


 
語(yǔ)法

以下是 update() 的語(yǔ)法:

update(id=0, username=None, password=None, phone='', email='', image='', role=0, period=0, allow=1, notes='')

參數(shù)

    ● id [int]:用戶id,為0時(shí)創(chuàng)建用戶,其它數(shù)值時(shí)修改用戶。
    ● username [str]:用戶名。
    ● password [str]:密碼,未加密前的原始密碼 md5(passowrd + encryption)。
    ● phone [str]:手機(jī)號(hào)。
    ● email [str]:E-Mail。
    ● image [str]:圖像url。
    ● role [int]:角色表關(guān)聯(lián)ID。
    ● period [int]:賬號(hào)有效時(shí)間戳,0表示永久。
    ● allow [int]:是否允許登錄,0表示禁止,1表示允許。
    ● note [str]:用戶備注信息。


返回值

返回一個(gè)字典。


實(shí)例

以下展示了使用 update() 的實(shí)例:

from kyger.admin import admin
return admin(self.db, self.kg).update(0, 'kgcms', 'test', '', '', period=0, allow=1)  # 創(chuàng)建管理員用戶

以上實(shí)例運(yùn)行后輸出的結(jié)果為:

{'state': 'SUCCESS', 'id': 7}  # 成功返回ID,失敗返回錯(cuò)誤消息:{'state': 'FAILURE', 'msg': ''}

適應(yīng)版本

v1.0.1