请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

老师您好,我保存不了地址

图片描述

首页图片正常显示 我连的是我服务器上的

图片描述

图片描述

老师帮我看看 什么原因

==========================================================

下面是日志

[root@iZbp1i0t9v2ixxhu5e9tewZ logs]# tail -f order.log 
    reraise(exc_type, exc_value, tb)
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./web/controllers/api/Address.py", line 110, in myAddressInfo
ValueError: invalid literal for int() with base 10: 'undefined'
[pid: 14873|app: 0|req: 99/1145] 183.195.23.207 () {48 vars in 978 bytes} [Mon Jul 15 18:23:18 2019] GET /api/my/address/info?id=undefined => generated 0 bytes in 9 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
[2019-07-15 18:24:40,809] INFO in ApiAuthInterceptor: /api/my/address/set
2019-07-15 18:24:40,810 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
2019-07-15 18:24:40,811 INFO sqlalchemy.engine.base.Engine SELECT member.id AS member_id, member.nickname AS member_nickname, member.mobile AS member_mobile, member.sex AS member_sex, member.avatar AS member_avatar, member.salt AS member_salt, member.reg_ip AS member_reg_ip, member.status AS member_status, member.updated_time AS member_updated_time, member.created_time AS member_created_time 
FROM member 
WHERE member.id = %s 
 LIMIT %s
2019-07-15 18:24:40,811 INFO sqlalchemy.engine.base.Engine ('1', 1)
[2019-07-15 18:24:40,812] INFO in ApiAuthInterceptor: <Member 1>
Traceback (most recent call last):
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/data/www/python3_vir/lib/python3.5/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./web/controllers/api/Address.py", line 34, in myAddressSet
ValueError: invalid literal for int() with base 10: 'undefined'
[pid: 14872|app: 0|req: 368/1146] 183.195.23.207 () {52 vars in 1018 bytes} [Mon Jul 15 18:24:40 2019] POST /api/my/address/set => generated 0 bytes in 9 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)

我的代码

    # id = int(req['id']) if 'id' in req and req['id'] else 0
    id = req['id'] if 'id' in req else 0

这两种都不行

===================

File “./web/controllers/api/Address.py”, line 110, in myAddressInfo 这个文件的110行是

    req = request.values

我在这里怎么上传不了图片了老师

正在回答

3回答

编程浪子 2019-07-15 23:23:37

你直接截图出来保存的整个方法,你说的和报错完全对应不上

0 回复 有任何疑惑可以回复我~
  • 提问者 慕妹4270370 #1
    <view class="add-btn" bindtap="addressSet" data-id="0">新增收货地址</view>
    我写的少了 data-id="0"
    回复 有任何疑惑可以回复我~ 2019-07-15 23:38:53
编程浪子 2019-07-15 20:48:30

你好

File "./web/controllers/api/Address.py", line 110, in myAddressInfo    这个文件的110行是什么


还有错误已经很明显了,invalid literal for int() with base 10: 'undefined'

讲一个 undefined的值 使用int 转化内心肯定转化不了了的,必须是10进制的

0 回复 有任何疑惑可以回复我~
编程浪子 2019-07-15 16:59:17

你好

502 后台代码错误,看后台命令行的报错信息

0 回复 有任何疑惑可以回复我~
  • 提问者 慕妹4270370 #1
    老师再看下,我添加的问题描述
    回复 有任何疑惑可以回复我~ 2019-07-15 18:32:54
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信