now you are doing the function of creating a new account
post:
I"ve been debugging all afternoon, but I still don"t know what the problem is. Cry ~
now you are doing the function of creating a new account
post:
I"ve been debugging all afternoon, but I still don"t know what the problem is. Cry ~
axios needs to add its own configuration using post request
use qs as a class library
import qs from 'qs';
axios.interceptors.request.use( (config) => {
if (config.method=="post"){
config.data = qs.stringify(config.data);
config.headers['Content-Type'] = 'application/x-www-form-urlencoded';
}
return config;
}, (error) => {
return Promise.reject(error);
});
write an api.js, creation interface, such as export const addUser = params = > {return axios.post ( ${base} / _ / api/v1/user
, params). Then (res = > res.data);
then import it with import on the page, and then use ~
the backend requires you to put the parameters into url
, and your post data is put into body, of course. You can do this by configuring post's config
.
is there another status parameter?
axios.post('/account/add',{
headers: {
Authorization : getCookie('token')
},
params:{
name:this.name,
email:this.email,
password:this.password,
status:1,
roleId:this.role
}
})
am I right to change to this?
what management interface does the back end of your company use?
Previous: Npm install reported an error
Next: Why does jquert get the parent element of the parent always reporting an error?
follow the online tutorials: main.js import VueI18n from vue-i18n ; Vue.use(VueI18n) const i18n = new VueI18n({ locale: English , messages:{ English : require( . common English.js ), } }) English.js export const m = ...
requirements: I want to reference a scss or less stylesheet globally. How can I call stylesheet variables and methods in various components? Has a great god ever done it? ...
<Form :model="configMode" inline :label-width="configAll ? configAll.labelWidth : 80"> <template v-for="(items, index) in configData"> <template v-if="items.cut === input " > ...