import Vue from 'vue';
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
import VueMask from 'v-mask'
import md5 from 'md5'
import App from './App.vue';
import {routes} from './routes';
import store from './store/index';
Vue.use(VueRouter);
Vue.use(VueResource);
Vue.use(VueMask);
Vue.http.options.root = 'http://food.idsi-apps.com/app/'
/*Vue.http.headers.common['Authorization'] = 'Basic 111';*/
const router = new VueRouter({
routes,
mode: 'history'
});
const app = new Vue({
router,
store,
render: h => h(App)
});
import Vue from 'vue';
import { router } from '../main';
//import routes from '../routes';
export default {
regSocialUser (user, cb, errorCb) {
console.log(user);
setTimeout(() => {
Vue.http.post('auth', {data : user} , {
emulateJSON: true
})
.then(response => {
if (response.body === 'done') {
localStorage.setItem('userAuth', 'yes')
this.userAuth = true;
debugger
this.$router.('/mobile/profile')
} else {
this.userAuth = false;
console.log(this.userAuth);
}
console.log(response);
}, error => {
console.log(error);
});
}, 100)
}
}
const state = {
user: {
id: null,
firstname: '',
addresses: [],
avatar: '',
lastname: '',
middlename: '',
notice_promo: '',
notice_status: '',
orders: {},
phone: '',
promocode: '',
promocodes: [],
registered: '',
userPath: ''
}
}
[types.RECEIVE_USER_PROMOCODES] (state, {promocodes}) {
<b> Vue.set(state.user, 'promocodes', promocodes);</b>
},
Но, если не сложно подскажите направление как сохранить эту картинку(передать в форме как input type file) или что-то подобное