Because it’s a little program, I’m using setData
annex = "zzzy_visa/web/uploads/20210108/aaa.png"
let pos = options.annex.lastIndexOf("/") //'/ last position '
let str = options.annex.substr(pos + 1) // Intercepts the file name string
url = name.substr(0,pos) // Intercepts the path string
this.setData({
upload_template: JSON.parse(options.upload_template),
annex: str
})
//=>aaa.png zzzy_visa/web/uploads/20210108
Copy the code