Home > Article > Web Front-end > How to upload VUE+UEditor images across domains
This time I will bring you VUE UEditor image cross-domain UploadHow to implement it, what are the precautions for implementing VUE UEditor image cross-domain upload, the following is a practical case , let’s take a look.
UEditor official website says that it does not provide cross-domain single image, so you can only solve it yourself. I checked many solutions on the Internet, but I didn't see any used with vue, but I got some ideas. I tried it on the basis that I didn't want to change too much source code... and it worked accidentally. Solution: When uploading a single image, the backend does not directly return JSON, but redirects to the front-end page
Front end: VUE
Backend: WAMP ThinkPHP5.0
front end
http://localhost:8888
1. Go to the official website to download UEditor into vue, open ueditor.config.jsConfigure the server path (the local domain name can be added to the hosts file), the following is my configuration
2. Open ueditor.all.js and search for
3. Create a page to display JSON data. I directly used routing parameters to receive the returned results and then spliced them together. The entire JSON could not be received, so I had to disassemble it. All the JSON was not displayed, and only the state and url were obtained. I don’t know yet how to receive backend data without accessing the interface. If you have a good solution, please suggest it.
rear end
http://localhost.server.com
1. Download the PHP version of UEditor, copy the files in the PHP folder inside to the project, and add judgment to the output results in the Controller. Single pictures do not directly return results
2. Modify the access path and save path of Config.json
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!
Recommended reading:
express method of building a query server
Customized ajax cross-domain component encapsulation
vue implements the progress bar of page loading
The above is the detailed content of How to upload VUE+UEditor images across domains. For more information, please follow other related articles on the PHP Chinese website!