tp6 constructor invalid
金**的落叶
金**的落叶 2022-05-09 08:54:18
0
4
1400

QQ图片20220509085239.jpgQQ图片20220509085246.jpg

Does anyone know what's going on? The return of the tp6 constructor method doesn't work. It's strange.

金**的落叶
金**的落叶

reply all(1)
autoload

Your usage is a bit strange. The constructor itself is to enrich the class attributes, to be precise, the object attributes. The constructor returns an object by default. If you customize the return 555, it will report an error. This is not tp6 problem.

  • reply In this case, I want to verify the token in the constructor. If the token expires, I will return the msg of re-logging in or re-obtaining it. Does this mean that the verification cannot be placed in the constructor?
    金**的落叶 author 2022-05-09 09:15:06
  • reply Just verify it in the request
    autoload author 2022-05-09 09:20:47
  • reply Does it mean to verify in getuserinfo?
    金**的落叶 author 2022-05-09 09:24:48
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template