Convert long number as string in the serialization

前端 未结 5 2136
一整个雨季
一整个雨季 2020-12-14 09:47

I have a custom made class that use a long as ID. However, when I call my action using ajax, my ID is truncated and it loses the last 2 numbers because javascript loses prec

5条回答
  •  [愿得一人]
    2020-12-14 10:37

    Maybe a viable workaround would be to use another type for the ID? You could use a GUID for example. With a GUID you will never run out of bounds and also this will get serialized as a string by default I think.

提交回复
热议问题