Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const store = new Vuex.Store({
- state: {},
- getters: {
- changeempdatas: (state) => {
- var apidata =Vue.axios.post ('http://127.0.0.1:5000/').then( (response) => {return response.data});
- var changeempdatas = apidata.then(function(result) {
- console.log(result.empdata)
- return result.empdata;
- })
- console.log(changeempdatas)
- return changeempdatas;
- }
- }
- });
- conn= pymysql.connect
- (host='127.0.0.1',user='root',password='',
- db='test')
- class senddata(Resource):
- def post(self):
- curr = conn.cursor()
- getdataqry = curr.execute("SELECT *
- FROM `employee`")
- getdatas = curr.fetchall()
- #empdata = []
- print "Post"
- i=0
- empdata = {}
- for getdata in getdatas:
- i += 1
- empdata[i] = {}
- empdata[i]['id'] = getdata[0]
- empdata[i]['name'] = getdata[1]
- #empdata.append({'id': getdata[0],
- 'name': getdata[1]})
- return jsonify({'empdata': empdata})
- a.close()
Add Comment
Please, Sign In to add comment