Commit eba96ec517efa304f76ca66dea222865baa9c191

Authored by Neeraj Sharma
1 parent 07c5c919f5

set login name on topnav

src/components/AppToolbar.vue
... ... @@ -17,7 +17,7 @@
17 17 >
18 18 </v-text-field> -->
19 19 <v-spacer></v-spacer>
20   -
  20 + <h5 class="white--text">{{userName}}</h5>
21 21 <v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition">
22 22 <v-btn icon large flat slot="activator">
23 23 <v-avatar size="40px">
... ... @@ -48,6 +48,7 @@ export default {
48 48 },
49 49 data: () => ({
50 50 search: "",
  51 + userName:'',
51 52 items: [
52 53 {
53 54 // icon: 'account_circle',
... ... @@ -88,7 +89,10 @@ export default {
88 89 handleFullScreen() {
89 90 Util.toggleFullScreen();
90 91 }
91   - }
  92 + },
  93 +mounted(){
  94 + this.userName = this.$store.state.name;
  95 +}
92 96 };
93 97 </script>
94 98 <style>
... ...
... ... @@ -14,6 +14,8 @@ export default [
14 14 text: 'Logout successfully.'
15 15 };
16 16 this.$store.dispatch('setToken', null)
  17 + this.$store.dispatch('setName', null)
  18 +
17 19 this.$router.replace({ path: '/' });
18 20 }
19 21 },
... ...
src/pages/Login.vue
... ... @@ -119,6 +119,7 @@ export default {
119 119 .post("/adminLogin", userdata)
120 120 .then(response => {
121 121 this.$store.dispatch("setToken", response.data.data.token);
  122 + this.$store.dispatch("setName", response.data.data.name);
122 123 this.loading = true;
123 124 if ((this.snackbar = true)) {
124 125 this.text = "Successfully Login";
... ...
src/pages/Provider.vue
1 1 <template>
2   -<!-- <v-container fluid> -->
3   -<v-flex xs12>
4   - <v-card>
5   - <v-card-title>
6   - <v-flex xs12 lg2 md3 sm4>
7   - <h4 class="text-xs-center"> Healthcare Providers </h4>
8   - </v-flex>
9   - <v-spacer></v-spacer>
10   - <!-- SEARCH ALL HEALTH PROVIDER -->
11   - <v-flex xs8 sm4 lg3>
12   - <v-text-field justify-right
13   - prepend-icon="search"
14   - v-model="search"
15   - label="Find Yours Users"
16   - color="black"
17   - ></v-text-field></v-flex>
18   - </v-card-title>
19   -<!-- EDIT HEALTH PROVIDER -->
20   - <v-snackbar
21   - :timeout="timeout"
22   - :top="y === 'top'"
23   - :right="x === 'right'"
24   - :vertical="mode === 'vertical'"
25   - v-model="snackbar"
26   - color="success"
27   - >{{ text }}</v-snackbar>
28   - <v-dialog v-model="dialog" max-width="500px">
29   - <v-toolbar color="white">
30   - <v-spacer></v-spacer>
31   - <v-toolbar-title>Edit Profile</v-toolbar-title>
32   - <v-spacer></v-spacer>
33   - </v-toolbar>
34   - <v-card>
35   - <v-flex align-center justify-center layout text-xs-center>
36   - <v-avatar size="50px" style="position:absolute; top:10px; ">
37   - <img src="/static/icon/user.png"/> </v-avatar>
38   - </v-flex>
  2 + <!-- <v-container fluid> -->
  3 + <v-flex xs12>
  4 + <v-card>
  5 + <v-card-title>
  6 + <v-flex xs12 lg2 md3 sm4>
  7 + <h4 class="text-xs-center">Healthcare Providers</h4>
  8 + </v-flex>
  9 + <v-spacer></v-spacer>
  10 + <!-- SEARCH ALL HEALTH PROVIDER -->
  11 + <v-flex xs8 sm4 lg3>
  12 + <v-text-field
  13 + justify-right
  14 + prepend-icon="search"
  15 + v-model="search"
  16 + label="Find Yours Users"
  17 + color="black"
  18 + ></v-text-field>
  19 + </v-flex>
  20 + </v-card-title>
  21 + <!-- EDIT HEALTH PROVIDER -->
  22 + <v-snackbar
  23 + :timeout="timeout"
  24 + :top="y === 'top'"
  25 + :right="x === 'right'"
  26 + :vertical="mode === 'vertical'"
  27 + v-model="snackbar"
  28 + color="success"
  29 + >{{ text }}</v-snackbar>
  30 + <v-dialog v-model="dialog" max-width="500px">
  31 + <v-toolbar color="white">
  32 + <v-spacer></v-spacer>
  33 + <v-toolbar-title>Edit Profile</v-toolbar-title>
  34 + <v-spacer></v-spacer>
  35 + </v-toolbar>
  36 + <v-card>
  37 + <v-flex align-center justify-center layout text-xs-center>
  38 + <v-avatar size="50px" style="position:absolute; top:10px; ">
  39 + <img src="/static/icon/user.png">
  40 + </v-avatar>
  41 + </v-flex>
39 42 <v-card-text>
40   - <v-container grid-list-md>
41   - <v-layout wrap justify-center>
42   - <v-flex xs12 sm9>
43   - <v-form ref="form" v-model="valid" lazy-validation>
44   - <v-layout style="position:relative; top:15px; ">
45   - <v-flex xs4 class="pt-4 subheading">
46   - <label>First Name: </label>
47   - </v-flex>
48   - <v-flex xs8>
49   - <v-text-field
50   - v-model="editedItem.name"
51   - :rules="nameRules"
52   - required
53   - ></v-text-field>
54   - </v-flex>
55   - </v-layout>
56   - <v-layout>
57   - <v-flex xs4 class="pt-4 subheading">
58   - <label>Last Name: </label>
59   - </v-flex>
60   - <v-flex xs8>
61   - <v-text-field
62   - v-model="editedItem.lastname"
63   - required
64   - ></v-text-field>
65   - </v-flex>
66   - </v-layout>
67   - <v-layout>
68   - <v-flex xs4 class="pt-4 subheading">
69   - <label>Email ID: </label>
70   - </v-flex>
71   - <v-flex xs8>
72   - <v-text-field
73   - v-model="editedItem.email"
74   - :rules="emailRules"
75   - data-vv-name="E-mail"
76   - required
77   - ></v-text-field></v-flex></v-layout>
78   - <v-card-actions>
79   - <v-btn round dark @click.native="close">Cancel</v-btn>
80   - <v-spacer></v-spacer>
81   - <v-btn round dark @click.native="save">Save</v-btn>
82   -
83   - </v-card-actions>
84   - </v-form>
85   -</v-flex>
86   -</v-layout>
87   -</v-container>
88   -</v-card-text>
89   -</v-card>
90   -</v-dialog>
91   -<!-- VIEW PROFILE PRVIDE LIST -->
92   -<v-dialog v-model="dialog1" max-width="700px" >
93   - <v-toolbar color="white">
94   - <v-spacer></v-spacer>
95   - <v-toolbar-title>Profile</v-toolbar-title>
96   - <v-spacer></v-spacer>
97   - <v-icon @click="close1">close</v-icon>
98   - </v-toolbar>
99   - <v-card>
100   - <v-flex align-center justify-center layout text-xs-center>
101   - <v-avatar size="60px" style="position:absolute; top:10px;">
102   - <img src="/static/icon/user.png"/> </v-avatar>
103   - </v-flex>
104   - <v-card-text>
105   - <v-container grid-list-md>
  43 + <v-container grid-list-md>
106 44 <v-layout wrap justify-center>
107   - <v-flex sm12 offset-sm3><br><br>
108   - <v-layout>
109   - <v-flex xs4>
110   - <h5 class="right">First Name:</h5>
  45 + <v-flex xs12 sm9>
  46 + <v-form ref="form" v-model="valid" lazy-validation>
  47 + <v-layout style="position:relative; top:15px; ">
  48 + <v-flex xs4 class="pt-4 subheading">
  49 + <label>First Name:</label>
  50 + </v-flex>
  51 + <v-flex xs8>
  52 + <v-text-field v-model="editedItem.name" :rules="nameRules" required></v-text-field>
  53 + </v-flex>
  54 + </v-layout>
  55 + <v-layout>
  56 + <v-flex xs4 class="pt-4 subheading">
  57 + <label>Last Name:</label>
  58 + </v-flex>
  59 + <v-flex xs8>
  60 + <v-text-field v-model="editedItem.lastname" required></v-text-field>
  61 + </v-flex>
  62 + </v-layout>
  63 + <v-layout>
  64 + <v-flex xs4 class="pt-4 subheading">
  65 + <label>Email ID:</label>
  66 + </v-flex>
  67 + <v-flex xs8>
  68 + <v-text-field
  69 + v-model="editedItem.email"
  70 + :rules="emailRules"
  71 + data-vv-name="E-mail"
  72 + required
  73 + ></v-text-field>
  74 + </v-flex>
  75 + </v-layout>
  76 + <v-card-actions>
  77 + <v-btn round dark @click.native="close">Cancel</v-btn>
  78 + <v-spacer></v-spacer>
  79 + <v-btn round dark @click.native="save">Save</v-btn>
  80 + </v-card-actions>
  81 + </v-form>
  82 + </v-flex>
  83 + </v-layout>
  84 + </v-container>
  85 + </v-card-text>
  86 + </v-card>
  87 + </v-dialog>
  88 + <!-- VIEW PROFILE PRVIDE LIST -->
  89 + <v-dialog v-model="dialog1" max-width="700px">
  90 + <v-toolbar color="white">
  91 + <v-spacer></v-spacer>
  92 + <v-toolbar-title>Profile</v-toolbar-title>
  93 + <v-spacer></v-spacer>
  94 + <v-icon @click="close1">close</v-icon>
  95 + </v-toolbar>
  96 + <v-card>
  97 + <v-flex align-center justify-center layout text-xs-center>
  98 + <v-avatar size="60px" style="position:absolute; top:10px;">
  99 + <img src="/static/icon/user.png">
  100 + </v-avatar>
  101 + </v-flex>
  102 + <v-card-text>
  103 + <v-container grid-list-md>
  104 + <v-layout wrap justify-center>
  105 + <v-flex sm12 offset-sm3>
  106 + <br>
  107 + <br>
  108 + <v-layout>
  109 + <v-flex xs4>
  110 + <h5 class="right">First Name:</h5>
111 111 </v-flex>
112 112 <v-flex xs8>
113   - <h5 class="left">{{ editedItem.name }}</h5>
114   - </v-flex>
115   - </v-layout>
  113 + <h5 class="left">{{ editedItem.name }}</h5>
  114 + </v-flex>
  115 + </v-layout>
116 116 <v-layout>
117   - <v-flex xs4>
118   - <h5 class="right my-3">Last Name:</h5>
  117 + <v-flex xs4>
  118 + <h5 class="right my-3">Last Name:</h5>
119 119 </v-flex>
120 120 <v-flex xs8>
121   - <h5 class="my-3 left" >{{ editedItem.name }}</h5>
122   - </v-flex>
123   - </v-layout>
  121 + <h5 class="my-3 left">{{ editedItem.name }}</h5>
  122 + </v-flex>
  123 + </v-layout>
124 124 <v-layout>
125   - <v-flex xs4 >
126   - <h5 class="right">Email:</h5>
  125 + <v-flex xs4>
  126 + <h5 class="right">Email:</h5>
127 127 </v-flex>
128 128 <v-flex xs8>
129   - <h5 class="left">{{ editedItem.email }}</h5>
130   - </v-flex>
131   - </v-layout>
  129 + <h5 class="left">{{ editedItem.email }}</h5>
  130 + </v-flex>
  131 + </v-layout>
132 132 </v-flex>
133 133 </v-layout>
134 134 </v-container>
135   - </v-card-text>
136   - </v-card>
137   -<!-- PROVIDER DATA TABLE PROVIDER DEATILS -->
138   -</v-dialog>
139   - <v-data-table
140   - :headers="headers"
141   - :items="desserts"
142   - :search="search"
143   - class="elevation-1"
144   - :pagination.sync="pagination"
145   - >
146   - <template slot="items" slot-scope="props">
147   - <v-snackbar
148   - :timeout="timeout"
149   - :top="y === 'top'"
150   - :right="x === 'right'"
151   - :vertical="mode === 'vertical'"
152   - v-model="statussnackbar"
153   - color="success"
154   - >{{ text }}</v-snackbar>
  135 + </v-card-text>
  136 + </v-card>
  137 + <!-- PROVIDER DATA TABLE PROVIDER DEATILS -->
  138 + </v-dialog>
  139 + <v-data-table
  140 + :headers="headers"
  141 + :items="desserts"
  142 + :search="search"
  143 + class="elevation-1"
  144 + :pagination.sync="pagination"
  145 + >
  146 + <template slot="items" slot-scope="props">
  147 + <v-snackbar
  148 + :timeout="timeout"
  149 + :top="y === 'top'"
  150 + :right="x === 'right'"
  151 + :vertical="mode === 'vertical'"
  152 + v-model="statussnackbar"
  153 + color="success"
  154 + >{{ text }}</v-snackbar>
155 155 <td id="td" class="text-xs-center">{{ props.index }}</td>
156 156 <td id="td" class="text-xs-center">{{ props.item.name}}</td>
157 157 <td id="td" class="text-xs-center">{{ props.item.email }}</td>
158 158 <td id="td" class="text-xs-center">
159 159 <v-flex xs12 sm12>
160   - <v-select
161   - :items="statusList"
162   - @change="changeswitch(props.item)"
163   - v-model="props.item.e1"
164   - menu-props="auto"
165   - :label="props.item.verified"
166   - hide-details
167   - single-line
168   - ></v-select>
  160 + <v-select
  161 + :items="statusList"
  162 + @change="changeswitch(props.item)"
  163 + v-model="props.item.e1"
  164 + menu-props="auto"
  165 + :label="props.item.verified"
  166 + hide-details
  167 + single-line
  168 + ></v-select>
169 169 </v-flex>
170   - </td>
171   - <td class="text-xs-center">
172   - <span>
173   - <img style="cursor:pointer; width:25px; height:18px; " class="mr-5" @click="profile(props.item)" src="/static/icon/eye1.png"/>
174   - <img style="cursor:pointer; width:20px; height:18px; " class="mr-5" @click="editItem(props.item)" src="/static/icon/edit1.png"/>
175   - <img style="cursor:pointer; height:20px; " class="mr-5" @click="deleteItem(props.item)" src="/static/icon/delete1.png"/>
176   - </span>
177   - </td>
178   -
179   - </template>
180   - </v-data-table>
181   -
182   -</v-card>
183   -</v-flex>
184   -<!-- </v-container> -->
  170 + </td>
  171 + <td class="text-xs-center">
  172 + <span>
  173 + <img
  174 + style="cursor:pointer; width:25px; height:18px; "
  175 + class="mr-5"
  176 + @click="profile(props.item)"
  177 + src="/static/icon/eye1.png"
  178 + >
  179 + <img
  180 + style="cursor:pointer; width:20px; height:18px; "
  181 + class="mr-5"
  182 + @click="editItem(props.item)"
  183 + src="/static/icon/edit1.png"
  184 + >
  185 + <img
  186 + style="cursor:pointer; height:20px; "
  187 + class="mr-5"
  188 + @click="deleteItem(props.item)"
  189 + src="/static/icon/delete1.png"
  190 + >
  191 + </span>
  192 + </td>
  193 + </template>
  194 + <v-alert
  195 + slot="no-results"
  196 + :value="true"
  197 + color="error"
  198 + icon="warning"
  199 + >Your search for "{{ search }}" found no results.</v-alert>
  200 + </v-data-table>
  201 + </v-card>
  202 + </v-flex>
  203 + <!-- </v-container> -->
185 204 </template>
186 205 <script>
187   -import http from '@/Services/http.js';
  206 +import http from "@/Services/http.js";
188 207 export default {
189 208 data: () => ({
190 209 snackbar: false,
191   - statussnackbar:false,
  210 + statussnackbar: false,
192 211 y: "top",
193 212 x: "right",
194 213 mode: "",
195 214 timeout: 3000,
196 215 text: "",
197   - valid: '',
198   - modaledit:false,
  216 + valid: "",
  217 + modaledit: false,
199 218 dialog: false,
200 219 dialog1: false,
201   - statusList: ["APPROVED","DECLINED"],
202   - search: '',
203   - e1: '',
  220 + statusList: ["APPROVED", "DECLINED"],
  221 + search: "",
  222 + e1: "",
204 223 rules: {
205   - required: value => !!value || 'This field is Required.',
206   - min: v => (/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/).test(v) && v.length > 0 || 'Please enter a date in the format dd/mm/yyyy'
  224 + required: value => !!value || "This field is Required.",
  225 + min: v =>
  226 + (/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/.test(
  227 + v
  228 + ) &&
  229 + v.length > 0) ||
  230 + "Please enter a date in the format dd/mm/yyyy"
207 231 },
208   - nameRules: [v => !!v || ' First Name is required'],
  232 + nameRules: [v => !!v || " First Name is required"],
209 233 // lnameRules: [v => !!v || ' Last Name is required'],
210 234 emailRules: [
211   - v => !!v || 'E-mail is required',
212   - v => /.+@.+/.test(v) || 'E-mail must be valid'
  235 + v => !!v || "E-mail is required",
  236 + v => /.+@.+/.test(v) || "E-mail must be valid"
213 237 ],
214 238 pagination: {
215   - rowsPerPage: 13,
216   -
  239 + rowsPerPage: 13
217 240 },
218 241 headers: [
219   - {
220   - text: 'No',
221   - align: 'center',
  242 + {
  243 + text: "No",
  244 + align: "center",
222 245 sortable: false,
223   - value: 'no'
  246 + value: "no"
224 247 },
225   - { text: 'Name', value: 'name', sortable: false, align: 'center' },
226   - { text: 'Email', value: 'email', sortable: false, align: 'center' },
227   - { text: 'Status', value: 'verified', sortable: false, align: 'center' },
228   - { text: '', value: '', sortable: false },
229   -
  248 + { text: "Name", value: "name", sortable: false, align: "center" },
  249 + { text: "Email", value: "email", sortable: false, align: "center" },
  250 + { text: "Status", value: "verified", sortable: false, align: "center" },
  251 + { text: "", value: "", sortable: false }
230 252 ],
231 253 desserts: [],
232 254 editedIndex: -1,
233 255 editedItem: {
234   - No: '',
235   - Name: '',
236   - lastname: '',
237   - Email: '',
238   - dob:''
  256 + No: "",
  257 + Name: "",
  258 + lastname: "",
  259 + Email: "",
  260 + dob: ""
239 261 },
240 262 defaultItem: {
241   - No: '',
242   - Name: '',
243   - lastname: '',
244   - Email: '',
245   - dob:''
246   - },
  263 + No: "",
  264 + Name: "",
  265 + lastname: "",
  266 + Email: "",
  267 + dob: ""
  268 + }
247 269 }),
248 270 watch: {
249   - dialog (val) {
  271 + dialog(val) {
250 272 val || this.close();
251 273 }
252 274 },
253 275  
254   - created () {
  276 + created() {
255 277 this.initialize();
256 278 },
257   - mounted(){
  279 + mounted() {
258 280 this.getProviderList();
259 281 },
260 282 methods: {
261   - getProviderList(){
262   - var token = this.$store.state.token
263   - http().get('/provider-list',{headers: {Authorization: 'Bearer '+ token}})
  283 + getProviderList() {
  284 + var token = this.$store.state.token;
  285 + http()
  286 + .get("/provider-list", {
  287 + headers: { Authorization: "Bearer " + token }
  288 + })
264 289 .then(response => {
265 290 this.desserts = response.data.data.providerList;
266   - }).catch(err => {
267   - console.log("err====>",err);
268   - })
  291 + })
  292 + .catch(err => {
  293 + console.log("err====>", err);
  294 + });
269 295 },
270   - initialize () {
  296 + initialize() {
271 297 this.desserts = [];
272 298 },
273 299  
274   - editItem (item) {
  300 + editItem(item) {
275 301 this.editedIndex = this.desserts.indexOf(item);
276 302 this.editedItem = Object.assign({}, item);
277 303 this.dialog = true;
278 304 },
279   - profile (item) {
  305 + profile(item) {
280 306 this.editedIndex = this.desserts.indexOf(item);
281 307 this.editedItem = Object.assign({}, item);
282 308 this.dialog1 = true;
283 309 },
284   - changeswitch(item){
  310 + changeswitch(item) {
285 311 let addStatus = {
286   - userId:item.userId,
287   - status:item.e1
  312 + userId: item.userId,
  313 + status: item.e1
288 314 };
289   - http().post("/approve-decline", addStatus)
  315 + http()
  316 + .post("/approve-decline", addStatus)
290 317 .then(response => {
291 318 if ((this.statussnackbar = true)) {
292   - this.text = "Successfully change your status is" + " " + item.e1;
  319 + this.text = "Successfully change your status is" + " " + item.e1;
293 320 }
294 321 this.getProviderList();
295 322 })
... ... @@ -297,15 +324,16 @@ export default {
297 324 console.log(error);
298 325 });
299 326 },
300   - deleteItem (item) {
  327 + deleteItem(item) {
301 328 let addUsers = {
302   - userId:item.userId
  329 + userId: item.userId
303 330 };
304   - http().post("/deleteProvider", addUsers)
  331 + http()
  332 + .post("/deleteProvider", addUsers)
305 333 .then(response => {
306   - if ((this.snackbar = true)) {
  334 + if ((this.snackbar = true)) {
307 335 this.text = "Successfully delete Health Care Priovider";
308   - }
  336 + }
309 337 this.getProviderList();
310 338 })
311 339 .catch(error => {
... ... @@ -313,27 +341,28 @@ export default {
313 341 });
314 342 },
315 343  
316   - close () {
  344 + close() {
317 345 this.dialog = false;
318 346 setTimeout(() => {
319 347 this.editedItem = Object.assign({}, this.defaultItem);
320 348 this.editedIndex = -1;
321 349 }, 300);
322 350 },
323   - close1 () {
  351 + close1() {
324 352 this.dialog1 = false;
325 353 },
326 354  
327   - save () {
328   - let editUsers = {
329   - name: this.editedItem.name +this.editedItem.lastname,
330   - dob: this.editedItem.dob,
  355 + save() {
  356 + let editUsers = {
  357 + name: this.editedItem.name + this.editedItem.lastname,
  358 + dob: this.editedItem.dob,
331 359 email: this.editedItem.email,
332 360 userId: this.editedItem.userId
333   - };
334   - http().post("/provider-detail", editUsers)
  361 + };
  362 + http()
  363 + .post("/provider-detail", editUsers)
335 364 .then(response => {
336   - if ((this.snackbar = true)) {
  365 + if ((this.snackbar = true)) {
337 366 this.text = "Successfully Edit Health Care Priovider";
338 367 }
339 368 this.getProviderList();
... ... @@ -341,45 +370,43 @@ export default {
341 370 .catch(error => {
342 371 console.log(error);
343 372 });
344   - this.close();
  373 + this.close();
345 374 }
346   - },
  375 + }
347 376 };
348 377 </script>
349 378 <style scoped>
350 379 .v-card__actions .v-btn {
351   -margin: 0px;
352   -min-width: 120px;
  380 + margin: 0px;
  381 + min-width: 120px;
353 382 }
354 383 #td {
355   - border: 1px solid #dddddd;
356   - padding: 8px;
  384 + border: 1px solid #dddddd;
  385 + padding: 8px;
357 386 }
358   -#flex{
359   -height: 300px;
  387 +#flex {
  388 + height: 300px;
360 389 }
361   -.v-select_selctions.v-select_slot.v-select_selection{
  390 +.v-select_selctions.v-select_slot.v-select_selection {
362 391 color: black !important;
363 392 }
364   -@media screen and (max-width:476px){
365   -.flex.xs4 {
  393 +@media screen and (max-width: 476px) {
  394 + .flex.xs4 {
366 395 flex-basis: 55.666667%;
367 396 max-width: 71.666667%;
  397 + }
368 398 }
369   -}
370   -@media screen and (max-width: 402px) {
371   -h5 {
  399 +@media screen and (max-width: 402px) {
  400 + h5 {
372 401 font-size: 13px;
373   -}
374   -/* .right{
  402 + }
  403 + /* .right{
375 404 float:none !important;
376 405 } */
377   -.left{
378   - float:none !important;
  406 + .left {
  407 + float: none !important;
  408 + }
379 409 }
380   -
381   -}
382   -
383 410 </style>
384 411  
385 412  
... ...
src/store/store.js
... ... @@ -13,8 +13,9 @@ export default new Vuex.Store({
13 13 token: null,
14 14 data: null,
15 15 isUserLoggedIn: false,
16   - username: null,
17   - password: null
  16 + userName: null,
  17 + password: null,
  18 + name:null
18 19 },
19 20 // serve as the one and only way to change the state of the data in the state object
20 21 mutations: {
... ... @@ -30,11 +31,14 @@ export default new Vuex.Store({
30 31 setUser (state, data) {
31 32 state.data = data
32 33 },
33   - User (state, username) {
34   - state.username = username
  34 + User (state, userName) {
  35 + state.userName = userName
35 36 },
36 37 password (state, password) {
37 38 state.password = password
  39 + },
  40 + setName(state,name){
  41 + state.name = name
38 42 }
39 43 },
40 44 //Action methods are referred to as being "dispatched"
... ... @@ -45,12 +49,15 @@ export default new Vuex.Store({
45 49 setUser ({commit}, data) {
46 50 commit('setUser', data)
47 51 },
48   - User ({commit}, username) {
49   - commit('User', username)
  52 + User ({commit}, userName) {
  53 + commit('User', userName)
50 54 },
51 55 password ({commit}, password) {
52 56 commit('password', password)
53 57 },
  58 + setName({commit},name) {
  59 + commit('setName',name)
  60 + }
54 61  
55 62 }
56 63  
... ...