Photodetector based on all-inorganic CsPbCl3 perovskite is drawing increasing interest owing to its stable chemical properties, suitable band gap and superior inherent optoelectronic properties. However, most of the perovskite detectors are fabricated from polycrystalline films with a number of grain boundaries and defects which would decline the device performance. At the same time, the performance of the device is sacrificed by the presence of a large amount of gaps between the metal electrodes and the material. Here, a high detective photodetector is demonstrated based on CsPbCl3 crystals by liquid-phase growth on pre-patterned Au electrodes. Heterojunctions fabricated by liquid-phase self-assembly synthesis form an embedded structure between metal electrodes and the material, which greatly enhances the contact area and reduces the dark current. The device serves as photodetectors with a responsivity of 62.5 μA/W and detectivity up to 1.79 × 1011 Jones. Furthermore, these devices exhibit outstanding performance of field-effect transistors with a remarkable on/off ratio of 107. These results offer novel insights for the exploration of high-performance photodetectors based on all-inorganic perovskite materials.