@jetthai/cuora 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.0.10](https://github.com/jetthai/cuora-module/compare/v1.0.9...v1.0.10) (2021-08-13)
6
+
7
+ ### [1.0.9](https://github.com/jetthai/cuora-module/compare/v1.0.8...v1.0.9) (2021-08-11)
8
+
5
9
  ### [1.0.8](https://github.com/jetthai/cuora-module/compare/v1.0.7...v1.0.8) (2021-08-10)
6
10
 
7
11
  ### [1.0.7](https://github.com/jetthai/cuora-module/compare/v1.0.6...v1.0.7) (2021-08-10)
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # cuora
2
+
3
+ > Intergrate API and Store for game.
4
+
5
+ ## Installation
6
+
7
+ Add @jetthai/cuora dependency to your project:
8
+
9
+ ```bash
10
+ npm install --save @jetthai/cuora
11
+ ```
package/index.js CHANGED
@@ -6,7 +6,7 @@ export default function (moduleOptions) {
6
6
  this.addPlugin({
7
7
  src: path.resolve(__dirname, './plugin/job/network.js'),
8
8
  options,
9
- mode: 'client'
9
+ mode: 'client',
10
10
  })
11
11
 
12
12
  this.addPlugin({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin/core.js CHANGED
@@ -437,11 +437,11 @@ function createStore({ $request }) {
437
437
  },
438
438
  async logout({ state, commit, getters, dispatch, rootGetters }) {
439
439
  try {
440
- // commit(`setModal`, null)
441
440
  await $request.send(api.logout())
442
- dispatch('detachToken')
443
441
  } catch (err) {
444
- console.log('[ERR] Logout Fail')
442
+ console.log('[ERR] Logout Fail', err)
443
+ } finally {
444
+ dispatch('detachToken')
445
445
  }
446
446
  },
447
447
  async fetchSiteConfig({ state, commit, getters, dispatch, rootGetters }) {
package/plugin/game.js CHANGED
@@ -11,7 +11,7 @@ const api = {
11
11
  logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
12
12
  }
13
13
 
14
- function createStore({$request}) {
14
+ function createStore({ $request }) {
15
15
  return {
16
16
  namespaced: true,
17
17
  state: () => ({
@@ -409,7 +409,7 @@ function createStore({$request}) {
409
409
 
410
410
  export default (ctx, inject) => {
411
411
  const { store, $request } = ctx
412
- store.registerModule('game', createStore({$request}))
412
+ store.registerModule('game', createStore({ $request }))
413
413
  }
414
414
 
415
415
  function extractInfoChangedGames(oldStatus, newStatus) {
package/plugin/payment.js CHANGED
@@ -8,7 +8,11 @@ const api = {
8
8
  getReward: (data) => ({ url: 'activities/rewards', method: 'post', params: data }),
9
9
  getRewardList: ({ count, appSecret }) => ({ url: 'activities/rewards', method: 'get', params: { count, appSecret } }),
10
10
  getPaymentInfo: () => ({ url: `payment/paymentInfo`, method: 'get' }),
11
- updatePaymentInfo: (payload) => ({ url: `payment/updatePaymentInfo`, method: 'post', params: payload }),
11
+ updatePaymentInfo: ({ bankCode, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn, bonus, paymentProvider }) => ({
12
+ url: 'payment/updatePaymentInfo',
13
+ method: 'post',
14
+ params: { bankCode, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn, bonus, paymentProvider }
15
+ }),
12
16
  getBankList: (paymentMethod) => ({ url: `payment/${paymentMethod}/getBankList`, method: 'get' }),
13
17
  makeTransaction: ({ type, payload, paymentMethod }) => ({
14
18
  url: `payment/${paymentMethod}/transaction`,
@@ -151,7 +155,7 @@ function createStore({ $request }) {
151
155
  }
152
156
  },
153
157
  async updatePaymentInfo({ dispatch }, payload) {
154
- const data = $loadingRequest(api.updatePaymentInfo(payload))
158
+ const data = $request.sendWithLoading(api.updatePaymentInfo(payload))
155
159
  await dispatch('core/fetchUserInfo', null, { root: true })
156
160
  return data
157
161
  },
@@ -209,23 +213,23 @@ function createStore({ $request }) {
209
213
  }
210
214
  },
211
215
  async collect({ commit, dispatch }, activityNo) {
212
- const { data } = await $loadingRequest(api.collect({ appSecret: clientSecret }))
216
+ const { data } = await $request.sendWithLoading(api.collect({ appSecret: clientSecret }))
213
217
  await dispatch('getActivityDetail', activityNo, { root: true })
214
218
  },
215
219
  async setBonusSetting({ commit, dispatch }, data) {
216
- return await $loadingRequest(api.setBonusSetting({ bonus: data }))
220
+ return await $request.sendWithLoading(api.setBonusSetting({ bonus: data }))
217
221
  },
218
222
  async getCurrentWithdrawRule({ commit, dispatch }) {
219
223
  const currentRule = await $request.send(api.getCurrentWithdrawRule())
220
224
  return ruleFormatter(currentRule.rules)
221
225
  },
222
226
  async convertFreeCredit({ dispatch }, exchangeType) {
223
- const convertResult = await $loadingRequest(api.convertFreeCredit({ exchangeType }))
227
+ const convertResult = await $request.sendWithLoading(api.convertFreeCredit({ exchangeType }))
224
228
  await dispatch('core/fetchUserInfo', null, { root: true })
225
229
  return convertResult
226
230
  },
227
231
  async mergeWallet({ dispatch }) {
228
- const convertResult = await $loadingRequest(api.mergeWallet())
232
+ const convertResult = await $request.sendWithLoading(api.mergeWallet())
229
233
  await dispatch('core/fetchUserInfo', null, { root: true })
230
234
  return convertResult
231
235
  },