from seatable_api import Base, context
from seatable_api.exception import AuthExpiredError
import datetime
import re
SeaTable API相关信息
server_url = context.server_url or ‘https://xxx.com’
api_token = ‘xxxxxx’ # 替换为实际API Token
base = Base(api_token, server_url)
base.auth()
获取当前登录用户的用户名和名称
current_user_id = context.current_username
print(current_user_id)
user_info = base.get_user_info(current_user_id)
current_user_name = user_info.get(‘name’, ‘unknown_user’)
print(current_user_name)
row_data = {
“协作人”: current_user_id
}
base.update_row(‘table1’, ‘SDRfW796QLGxm8JGFlRbYg’, row_data)
current_user_id和current_user_name都写不进去,反而会把原来存在的协作人清除,但是打印出来都有数据,求解答!感谢!