From b328fcb71d65be39373ef2b36f410449a220fe79 Mon Sep 17 00:00:00 2001 From: laurieryayoi <14360417+laurieryayoi@users.noreply.github.com> Date: Mon, 4 Feb 2019 01:01:56 +0800 Subject: [PATCH 01/27] =?UTF-8?q?=E8=BF=94=E5=88=A9=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controllers/VueController.php | 3 + config/routes.php | 2 +- uim-index-dev/src/components/anchor.vue | 1 + uim-index-dev/src/components/pagenation.vue | 115 +++++++ .../src/components/panel/UserGuide.vue | 32 +- .../src/components/panel/UserInvite.vue | 319 +++++++++++------- uim-index-dev/src/components/table.vue | 37 ++ uim-index-dev/src/css/index.css | 29 ++ 8 files changed, 407 insertions(+), 131 deletions(-) create mode 100644 uim-index-dev/src/components/pagenation.vue create mode 100644 uim-index-dev/src/components/table.vue diff --git a/app/Controllers/VueController.php b/app/Controllers/VueController.php index a4f44aa9..960809dc 100644 --- a/app/Controllers/VueController.php +++ b/app/Controllers/VueController.php @@ -172,6 +172,9 @@ class VueController extends BaseController { "paybacks_sum" => $paybacks_sum, "invitePrice" => Config::get('invite_price'), "customPrice" => Config::get('custom_invite_price'), + "invite_gift" => Config::get('invite_gift'), + "invite_get_money" => Config::get('invite_get_money'), + "code_payback" => Config::get('code_payback'), ); $res['ret'] = 1; diff --git a/config/routes.php b/config/routes.php index 0477089f..d7000649 100755 --- a/config/routes.php +++ b/config/routes.php @@ -373,7 +373,7 @@ $app->group("/doiam", function () { $app->get('/logout', 'App\Controllers\VueController:vuelogout'); $app->get('/globalconfig', 'App\Controllers\VueController:getGlobalConfig'); $app->get('/getuserinfo', 'App\Controllers\VueController:getUserInfo'); -$app->get('/getuserinviteinfo', 'App\Controllers\VueController:getUserInviteInfo'); +$app->post('/getuserinviteinfo', 'App\Controllers\VueController:getUserInviteInfo'); $app->get('/getusershops', 'App\Controllers\VueController:getUserShops'); $app->get('/getallresourse', 'App\Controllers\VueController:getAllResourse'); $app->get('/getnewsubtoken', 'App\Controllers\VueController:getNewSubToken'); diff --git a/uim-index-dev/src/components/anchor.vue b/uim-index-dev/src/components/anchor.vue index 0f9b53c5..530744f7 100644 --- a/uim-index-dev/src/components/anchor.vue +++ b/uim-index-dev/src/components/anchor.vue @@ -32,6 +32,7 @@ export default { transition: all 0.3s; cursor: pointer; z-index: 1; + outline: none; } .uim-anchor li:hover { diff --git a/uim-index-dev/src/components/pagenation.vue b/uim-index-dev/src/components/pagenation.vue new file mode 100644 index 00000000..851f0d69 --- /dev/null +++ b/uim-index-dev/src/components/pagenation.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/uim-index-dev/src/components/panel/UserGuide.vue b/uim-index-dev/src/components/panel/UserGuide.vue index 9039db22..d9f77836 100644 --- a/uim-index-dev/src/components/panel/UserGuide.vue +++ b/uim-index-dev/src/components/panel/UserGuide.vue @@ -94,6 +94,7 @@ name="iosAccount" readonly="readonly" class="tips tips-blue" + :value="iosAccount" > @@ -244,34 +246,31 @@ export default { }, { num: "SSTAP游戏端", - content: - "", - id: "GT_W_0_5", + content: "", + id: "GT_W_0_5" }, { num: 1, content: "下载SSTap,并安装,期间会安装虚拟网卡,请点击允许或确认", - id: "GT_W_0_6", + id: "GT_W_0_6" }, { num: 2, - content: - "打开桌面程序SSTAP", - id: "GT_W_0_7", + content: "打开桌面程序SSTAP", + id: "GT_W_0_7" }, { num: 3, - content: - "齿轮图标-SSR订阅-SSR订阅管理添加以下订阅链接即可", - id: "GT_W_0_8", + content: "齿轮图标-SSR订阅-SSR订阅管理添加以下订阅链接即可", + id: "GT_W_0_8" }, { num: 4, content: "更新后选择其中一个节点闪电图标测试节点-测试UDP转发...通过!(UDP通过即可连接并开始游戏)", - id: "GT_W_0_9", - }, + id: "GT_W_0_9" + } ] }, { @@ -681,12 +680,11 @@ export default { id: "GT_I_2_2" }, { - num: '备用', - content: - "使用shadowrocket一键订阅", + num: "备用", + content: "使用shadowrocket一键订阅", id: "GT_I_2_3", - extra: true, - }, + extra: true + } ] }, { diff --git a/uim-index-dev/src/components/panel/UserInvite.vue b/uim-index-dev/src/components/panel/UserInvite.vue index 85707310..9ac6073f 100644 --- a/uim-index-dev/src/components/panel/UserInvite.vue +++ b/uim-index-dev/src/components/panel/UserInvite.vue @@ -1,125 +1,183 @@ + diff --git a/uim-index-dev/src/components/table.vue b/uim-index-dev/src/components/table.vue new file mode 100644 index 00000000..4f3a69f8 --- /dev/null +++ b/uim-index-dev/src/components/table.vue @@ -0,0 +1,37 @@ + + + + + + diff --git a/uim-index-dev/src/css/index.css b/uim-index-dev/src/css/index.css index 44ee5a31..f9a32359 100644 --- a/uim-index-dev/src/css/index.css +++ b/uim-index-dev/src/css/index.css @@ -29,6 +29,10 @@ a { justify-content: space-around; } +.flex-end { + justify-content: flex-end; +} + .space-between { justify-content: space-between; } @@ -568,6 +572,11 @@ select { outline: none; } +.tips-sm { + font-size: 12px; + padding: .1rem .5rem; +} + .tips-blue { color: #1997c6; border-color: #1997c6; @@ -654,6 +663,12 @@ button.tips { overflow: auto; } +.user-guide input { + background: transparent; + height: unset; + display: block; +} + .guide-area>p:first-of-type{ margin-top: 0; } @@ -753,6 +768,10 @@ button.tips { position: relative; } +.user-invite-title .btn-user { + margin-right: 1rem; +} + .list-shop { padding: .5rem; font-size: 1.2rem; @@ -928,6 +947,10 @@ button[name=reset] { overflow: auto; } + .user-invite { + max-height: 385px; + } + .user-guide { height: 385px; } @@ -981,6 +1004,12 @@ button[name=reset] { .user-btngroup .btngroup-right>*:last-child { margin-right: 0; } + + .userinvite-table-container { + overflow: auto; + max-height: 385px; + } + } @media screen and (min-width:48em) { From 4fb00565a85c679f47536c65f082b358bd35159a Mon Sep 17 00:00:00 2001 From: laurieryayoi <14360417+laurieryayoi@users.noreply.github.com> Date: Mon, 4 Feb 2019 01:47:43 +0800 Subject: [PATCH 02/27] =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controllers/VueController.php | 6 ++---- uim-index-dev/src/App.vue | 18 +++++++++++------- uim-index-dev/src/components/pagenation.vue | 19 +++++++++++-------- .../src/components/panel/UserInvite.vue | 2 ++ uim-index-dev/src/components/table.vue | 1 + uim-index-dev/src/css/index.css | 2 +- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/app/Controllers/VueController.php b/app/Controllers/VueController.php index 960809dc..bc66074a 100644 --- a/app/Controllers/VueController.php +++ b/app/Controllers/VueController.php @@ -156,10 +156,8 @@ class VueController extends BaseController { $code = InviteCode::where('user_id', $this->user->id)->first(); } - $pageNum = 1; - if (isset($request->getQueryParams()["page"])) { - $pageNum = $request->getQueryParams()["page"]; - } + $pageNum = $request->getParam('current'); + $paybacks = Payback::where("ref_by", $this->user->id)->orderBy("id", "desc")->paginate(15, ['*'], 'page', $pageNum); if (!$paybacks_sum = Payback::where("ref_by", $this->user->id)->sum('ref_get')) { $paybacks_sum = 0; diff --git a/uim-index-dev/src/App.vue b/uim-index-dev/src/App.vue index 1c26aa09..d58e5725 100644 --- a/uim-index-dev/src/App.vue +++ b/uim-index-dev/src/App.vue @@ -206,7 +206,9 @@ export default { .fade-enter, .fade-leave-to, .loading-fade-leave-to, -.loading-fadex-leave-to { +.loading-fadex-leave-to, +.list-fade-enter, +.list-fade-leave-to { opacity: 0; } .list-enter { @@ -217,18 +219,20 @@ export default { transform: translateY(20px); opacity: 0; } -.list-enter-active { - transition: all 0.5s ease; +.list-enter-active, +.list-fade-enter-active { + transition: all 0.3s ease; overflow: hidden; - transition-delay: .5s; + transition-delay: .4s; position: relative; } -.list-leave-active { - transition: all 0.5s cubic-bezier(1, 0.5, 0.8, 1); +.list-leave-active, +.list-fade-leave-active { + transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1); position: relative; overflow: hidden; } .list-move { - transition: all .5s; + transition: all .3s; } diff --git a/uim-index-dev/src/components/pagenation.vue b/uim-index-dev/src/components/pagenation.vue index 851f0d69..d63e1410 100644 --- a/uim-index-dev/src/components/pagenation.vue +++ b/uim-index-dev/src/components/pagenation.vue @@ -1,16 +1,16 @@ diff --git a/uim-index-dev/src/components/switch.vue b/uim-index-dev/src/components/switch.vue index dc3ccae1..d24125d0 100644 --- a/uim-index-dev/src/components/switch.vue +++ b/uim-index-dev/src/components/switch.vue @@ -15,25 +15,25 @@ - diff --git a/uim-index-dev/src/components/table.vue b/uim-index-dev/src/components/table.vue index 9cd46817..3321975e 100644 --- a/uim-index-dev/src/components/table.vue +++ b/uim-index-dev/src/components/table.vue @@ -10,7 +10,7 @@ - diff --git a/uim-index-dev/src/components/tooltip.vue b/uim-index-dev/src/components/tooltip.vue index 03afd377..c0a23e78 100644 --- a/uim-index-dev/src/components/tooltip.vue +++ b/uim-index-dev/src/components/tooltip.vue @@ -7,7 +7,7 @@ - diff --git a/uim-index-dev/src/directives/uimclip.js b/uim-index-dev/src/directives/uimclip.js index bafeeebd..3a372fe3 100644 --- a/uim-index-dev/src/directives/uimclip.js +++ b/uim-index-dev/src/directives/uimclip.js @@ -1,22 +1,22 @@ export default { - inserted: function (el, binding) { - el.addEventListener('click', (e) => { - let copy = new Promise((resolve, reject) => { - let input = document.createElement('input'); - let body = document.getElementsByTagName('body')[0]; - let value = el.dataset.uimclip; - input.setAttribute('type', 'text'); - input.setAttribute('value', value); - body.appendChild(input); - input.focus(); - input.setSelectionRange(0, value.length); - document.execCommand('copy', true); - resolve(input); - }) - copy.then((r) => { - r.remove(); - binding.value.onSuccess(); - }) - }) - }, -} \ No newline at end of file + inserted: function (el, binding) { + el.addEventListener('click', (e) => { + let copy = new Promise((resolve, reject) => { + let input = document.createElement('input') + let body = document.getElementsByTagName('body')[0] + let value = el.dataset.uimclip + input.setAttribute('type', 'text') + input.setAttribute('value', value) + body.appendChild(input) + input.focus() + input.setSelectionRange(0, value.length) + document.execCommand('copy', true) + resolve(input) + }) + copy.then((r) => { + r.remove() + binding.value.onSuccess() + }) + }) + } +} diff --git a/uim-index-dev/src/js/fetch.js b/uim-index-dev/src/js/fetch.js index c9f08d21..30f51977 100644 --- a/uim-index-dev/src/js/fetch.js +++ b/uim-index-dev/src/js/fetch.js @@ -10,27 +10,25 @@ * @param {string} method * @returns {function} - A Promise Object */ -export const _request = (url, body, method,credentials) => - fetch(url, { - method: method, - body: body, - headers: { - 'content-type': 'application/json' - }, - credentials: credentials, - }).then(resp => { - return Promise.all([resp.ok, resp.status, resp.json()]); - }).then(([ok, status, json]) => { - if (ok) { - return json; - } else { - throw new Error(JSON.stringify(json.error)); - } - }).catch(error => { - throw error; - }); - - +export const _request = (url, body, method, credentials) => + fetch(url, { + method: method, + body: body, + headers: { + 'content-type': 'application/json' + }, + credentials: credentials + }).then(resp => { + return Promise.all([resp.ok, resp.status, resp.json()]) + }).then(([ok, status, json]) => { + if (ok) { + return json + } else { + throw new Error(JSON.stringify(json.error)) + } + }).catch(error => { + throw error + }) /** * A Wrapper of Fetch GET Method @@ -40,25 +38,24 @@ export const _request = (url, body, method,credentials) => * @example * get('https://example.com').then(resp => { console.log(resp) }) */ -export const _get = (url,credentials) => - fetch(url, { - method: 'GET', - credentials, - }).then(resp => { - return Promise.all([resp.ok, resp.status, resp.json(), resp.headers]) - }) +export const _get = (url, credentials) => + fetch(url, { + method: 'GET', + credentials + }).then(resp => { + return Promise.all([resp.ok, resp.status, resp.json(), resp.headers]) + }) .then(([ok, status, json, headers]) => { - if (ok) { - return json; - } else { - throw new Error(JSON.stringify(json.error)); - } + if (ok) { + return json + } else { + throw new Error(JSON.stringify(json.error)) + } }).catch(error => { - console.log(error); - throw error; - }); + console.log(error) + throw error + }) - /** * A Wrapper of Fetch POST Method * @function _post @@ -69,4 +66,4 @@ export const _get = (url,credentials) => * _post('https://example.com', JSON.stringify(data)).then(resp => { console.log(resp) }) */ -export const _post = (url, body, credentials) => _request(url, body, 'POST', credentials); \ No newline at end of file +export const _post = (url, body, credentials) => _request(url, body, 'POST', credentials) diff --git a/uim-index-dev/src/main.js b/uim-index-dev/src/main.js index d1461af4..5d9a306e 100644 --- a/uim-index-dev/src/main.js +++ b/uim-index-dev/src/main.js @@ -3,16 +3,16 @@ import App from './App.vue' import './css/index_base.css' import './css/index.css' -Vue.config.productionTip = false; - import Uimclip from './directives/uimclip' -let validate,captcha; -window.validate = validate; -window.captha = captcha; +Vue.config.productionTip = false + +let validate, captcha +window.validate = validate +window.captha = captcha -Vue.directive('uimclip',Uimclip) +Vue.directive('uimclip', Uimclip) new Vue({ render: h => h(App) -}).$mount('#app') \ No newline at end of file +}).$mount('#app') diff --git a/uim-index-dev/src/mixins/agentMixin.js b/uim-index-dev/src/mixins/agentMixin.js index 9b10f02f..3c6213f1 100644 --- a/uim-index-dev/src/mixins/agentMixin.js +++ b/uim-index-dev/src/mixins/agentMixin.js @@ -1,168 +1,168 @@ export default { - computed: { - suburlBase: function () { - return this.subUrl + this.ssrSubToken; - }, - suburlMu0: function () { - return this.suburlBase + "?mu=0"; - }, - suburlMu1: function () { - return this.suburlBase + "?mu=1"; - }, - suburlMu3: function () { - return this.suburlBase + "?mu=3"; - }, - suburlMu2: function () { - return this.suburlBase + "?mu=2"; - } + computed: { + suburlBase: function () { + return this.subUrl + this.ssrSubToken }, - data: function () { - return { - downloads: [{ - type: "SSR", - agent: { - Windows: [{ - agentName: "SSR", - href: "/ssr-download/ssr-win.7z", - id: "AGENT_1_1_1" - }, - { - agentName: "SSTAP", - href: "/ssr-download/SSTap.7z", - id: "AGENT_1_1_2" - } - ], - Macos: [{ - agentName: "SSX", - href: "/ssr-download/ssr-mac.dmg", - id: "AGENT_1_2_1" - }], - Linux: [{ - agentName: "SS-qt5", - href: "#", - id: "AGENT_1_3_1" - }], - Ios: [{ - agentName: "Potatso Lite", - href: "#", - id: "AGENT_1_4_1" - }, - { - agentName: "Shadowrocket", - href: "#", - id: "AGENT_1_4_2" - } - ], - Android: [{ - agentName: "SSR", - href: "/ssr-download/ssr-android.apk", - id: "AGENT_1_5_1" - }, - { - agentName: "SSRR", - href: "/ssr-download/ssrr-android.apk", - id: "AGENT_1_5_2" - } - ], - Router: [{ - agentName: "FancySS", - href: "https://github.com/hq450/fancyss_history_package", - id: "AGENT_1_6_1" - }] - } - }, - { - type: "SS/SSD", - agent: { - Windows: [{ - agentName: "SSD", - href: "/ssr-download/ssd-win.7z", - id: "AGENT_2_1_1" - }], - Macos: [{ - agentName: "SSXG", - href: "/ssr-download/ss-mac.zip", - id: "AGENT_2_2_1" - }], - Linux: [{ - agentName: "/", - href: "#", - id: "AGENT_2_3_1" - }], - Ios: [{ - agentName: "Potatso Lite", - href: "#", - id: "AGENT_2_4_1" - }, - { - agentName: "Shadowrocket", - href: "#", - id: "AGENT_2_4_2" - } - ], - Android: [{ - agentName: "SSD", - href: "/ssr-download/ssd-android.apk", - id: "AGENT_2_5_1" - }, - { - agentName: "混淆插件", - href: "/ssr-download/ss-android-obfs.apk", - id: "AGENT_2_5_2" - } - ], - Router: [{ - agentName: "FancySS", - href: "https://github.com/hq450/fancyss_history_package", - id: "AGENT_2_6_1" - }] - } - }, - { - type: "V2RAY", - agent: { - Windows: [{ - agentName: "V2RayN", - href: "/ssr-download/v2rayn.zip", - id: "AGENT_3_1_1" - }, { - agentName: "ClashX", - href: "/ssr-download/Clash-Windows.7z", - id: "AGENT_3_1_2" - }], - Macos: [{ - agentName: "/", - href: "#", - id: "AGENT_3_2_1" - }], - Linux: [{ - agentName: "/", - href: "#", - id: "AGENT_3_3_1" - }], - Ios: [{ - agentName: "Shadowrocket", - href: "#", - id: "AGENT_3_4_1" - }], - Android: [{ - agentName: "V2RayN", - href: "/ssr-download/v2rayng.apk", - id: "AGENT_3_5_1" - }], - Router: [{ - agentName: "FancySS", - href: "https://github.com/hq450/fancyss_history_package", - id: "AGENT_3_6_1" - }] - } - } - ], - } + suburlMu0: function () { + return this.suburlBase + '?mu=0' + }, + suburlMu1: function () { + return this.suburlBase + '?mu=1' }, - methods: { - changeAgentType(e) { - this.setCurrentDlType(e.target.dataset.type); - }, + suburlMu3: function () { + return this.suburlBase + '?mu=3' }, -} \ No newline at end of file + suburlMu2: function () { + return this.suburlBase + '?mu=2' + } + }, + data: function () { + return { + downloads: [{ + type: 'SSR', + agent: { + Windows: [{ + agentName: 'SSR', + href: '/ssr-download/ssr-win.7z', + id: 'AGENT_1_1_1' + }, + { + agentName: 'SSTAP', + href: '/ssr-download/SSTap.7z', + id: 'AGENT_1_1_2' + } + ], + Macos: [{ + agentName: 'SSX', + href: '/ssr-download/ssr-mac.dmg', + id: 'AGENT_1_2_1' + }], + Linux: [{ + agentName: 'SS-qt5', + href: '#', + id: 'AGENT_1_3_1' + }], + Ios: [{ + agentName: 'Potatso Lite', + href: '#', + id: 'AGENT_1_4_1' + }, + { + agentName: 'Shadowrocket', + href: '#', + id: 'AGENT_1_4_2' + } + ], + Android: [{ + agentName: 'SSR', + href: '/ssr-download/ssr-android.apk', + id: 'AGENT_1_5_1' + }, + { + agentName: 'SSRR', + href: '/ssr-download/ssrr-android.apk', + id: 'AGENT_1_5_2' + } + ], + Router: [{ + agentName: 'FancySS', + href: 'https://github.com/hq450/fancyss_history_package', + id: 'AGENT_1_6_1' + }] + } + }, + { + type: 'SS/SSD', + agent: { + Windows: [{ + agentName: 'SSD', + href: '/ssr-download/ssd-win.7z', + id: 'AGENT_2_1_1' + }], + Macos: [{ + agentName: 'SSXG', + href: '/ssr-download/ss-mac.zip', + id: 'AGENT_2_2_1' + }], + Linux: [{ + agentName: '/', + href: '#', + id: 'AGENT_2_3_1' + }], + Ios: [{ + agentName: 'Potatso Lite', + href: '#', + id: 'AGENT_2_4_1' + }, + { + agentName: 'Shadowrocket', + href: '#', + id: 'AGENT_2_4_2' + } + ], + Android: [{ + agentName: 'SSD', + href: '/ssr-download/ssd-android.apk', + id: 'AGENT_2_5_1' + }, + { + agentName: '混淆插件', + href: '/ssr-download/ss-android-obfs.apk', + id: 'AGENT_2_5_2' + } + ], + Router: [{ + agentName: 'FancySS', + href: 'https://github.com/hq450/fancyss_history_package', + id: 'AGENT_2_6_1' + }] + } + }, + { + type: 'V2RAY', + agent: { + Windows: [{ + agentName: 'V2RayN', + href: '/ssr-download/v2rayn.zip', + id: 'AGENT_3_1_1' + }, { + agentName: 'ClashX', + href: '/ssr-download/Clash-Windows.7z', + id: 'AGENT_3_1_2' + }], + Macos: [{ + agentName: '/', + href: '#', + id: 'AGENT_3_2_1' + }], + Linux: [{ + agentName: '/', + href: '#', + id: 'AGENT_3_3_1' + }], + Ios: [{ + agentName: 'Shadowrocket', + href: '#', + id: 'AGENT_3_4_1' + }], + Android: [{ + agentName: 'V2RayN', + href: '/ssr-download/v2rayng.apk', + id: 'AGENT_3_5_1' + }], + Router: [{ + agentName: 'FancySS', + href: 'https://github.com/hq450/fancyss_history_package', + id: 'AGENT_3_6_1' + }] + } + } + ] + } + }, + methods: { + changeAgentType (e) { + this.setCurrentDlType(e.target.dataset.type) + } + } +} diff --git a/uim-index-dev/src/mixins/storeAuth.js b/uim-index-dev/src/mixins/storeAuth.js index bfdc8835..d1b8b84e 100644 --- a/uim-index-dev/src/mixins/storeAuth.js +++ b/uim-index-dev/src/mixins/storeAuth.js @@ -1,64 +1,59 @@ import { _get } from '../js/fetch' export default { - data: function() { - return { - validate: '', - captcha: '', - } + data: function () { + return { + validate: '', + captcha: '' + } + }, + methods: { + loadCaptcha (id) { + if (this.globalConfig.recaptchaSiteKey !== null) { + this.$nextTick(function () { + this.grecaptchaRender(id) + }) + } }, - methods: { - loadCaptcha(id) { - if (this.globalConfig.recaptchaSiteKey !== null) { - this.$nextTick(function () { - this.grecaptchaRender(id); + loadGT (id) { + if (this.globalConfig.captchaProvider === 'geetest') { + this.$nextTick(function () { + _get('/getCaptcha', 'include') + .then((r) => { + let GeConfig = { + gt: r.GtSdk.gt, + challenge: r.GtSdk.challenge, + product: 'embed' + } + + if (parseInt(this.globalConfig.isGetestSuccess)) { + GeConfig.offline = 0 + } else { + GeConfig.offline = 1 + } + + let self = this + + initGeetest(GeConfig, function (captchaObj) { + captchaObj.appendTo(id) + captchaObj.onSuccess(function () { + self.validate = captchaObj.getValidate() }) - } - }, - loadGT(id) { - - if (this.globalConfig.captchaProvider === 'geetest') { - this.$nextTick(function () { - - _get('/auth/login_getCaptcha', 'include') - .then((r) => { - - let GeConfig = { - gt: r.GtSdk.gt, - challenge: r.GtSdk.challenge, - product: "embed", - } - - if (parseInt(this.globalConfig.isGetestSuccess)) { - GeConfig.offline = 0; - } else { - GeConfig.offline = 1; - } - - let self = this; - - initGeetest(GeConfig, function (captchaObj) { - captchaObj.appendTo(id); - captchaObj.onSuccess(function () { - self.validate = captchaObj.getValidate(); - }); - self.captcha = captchaObj; - }); - - }); - - }); - } - }, - //加载完成的时间很谜 - grecaptchaRender(id) { - setTimeout(() => { - if (!grecaptcha || !grecaptcha.render) { - this.grecaptchaRender(id); - } else { - grecaptcha.render(id); - } - }, 300) - } + self.captcha = captchaObj + }) + }) + }) + } }, -} \ No newline at end of file + // 加载完成的时间很谜 + grecaptchaRender (id) { + setTimeout(() => { + if (!grecaptcha || !grecaptcha.render) { + this.grecaptchaRender(id) + } else { + grecaptcha.render(id) + } + }, 300) + } + } +} diff --git a/uim-index-dev/src/mixins/storeMap.js b/uim-index-dev/src/mixins/storeMap.js index 92be5fbc..e1e3af9d 100644 --- a/uim-index-dev/src/mixins/storeMap.js +++ b/uim-index-dev/src/mixins/storeMap.js @@ -1,63 +1,66 @@ import { - mapActions + mapActions } from 'vuex' import { - mapState + mapState } from 'vuex' import { - mapMutations + mapMutations } from 'vuex' import tmp from '../store' export default { - store: tmp, - computed: mapState({ - msgrCon: 'msgrCon', - modalCon: 'modalCon', - globalConfig: 'globalConfig', - logintoken: 'logintoken', - isLoading: 'isLoading', - userCon: state => state.userState.userCon, - userSettings: state => state.userState.userSettings, - currentDlType: state => state.userState.currentDlType, - currentPlantformType: state => state.userState.currentPlantformType, - ssrSubToken: state => state.userState.ssrSubToken, - subUrl: state => state.userState.subUrl, - iosAccount: state => state.userState.iosAccount, - iosPassword: state => state.userState.iosPassword, - displayIosClass: state => state.userState.displayIosClass, + store: tmp, + computed: mapState({ + msgrCon: 'msgrCon', + modalCon: 'modalCon', + globalConfig: 'globalConfig', + logintoken: 'logintoken', + isLoading: 'isLoading', + userCon: state => state.userState.userCon, + userSettings: state => state.userState.userSettings, + currentDlType: state => state.userState.currentDlType, + currentPlantformType: state => state.userState.currentPlantformType, + ssrSubToken: state => state.userState.ssrSubToken, + subUrl: state => state.userState.subUrl, + iosAccount: state => state.userState.iosAccount, + iosPassword: state => state.userState.iosPassword, + displayIosClass: state => state.userState.displayIosClass, + sign: state => state.userState.sign + }), + methods: { + ...mapActions({ + callMsgr: 'CALL_MSGR', + callModal: 'CALL_MODAL', + TraffictransTrigger: 'TraffictransTrigger' }), - methods: { - ...mapActions({ - callMsgr: 'CALL_MSGR', - callModal: 'CALL_MODAL', - }), - ...mapMutations({ - setGlobalConfig: 'SET_GLOBALCONFIG', - setHitokoto: 'SET_HITOKOTO', - setJinRiShiCi: 'SET_JINRISHICI', - setLoadState: 'SET_LOADSTATE', - setLoginToken: 'SET_LOGINTOKEN', - setUserMoney: 'SET_USERMONEY', - setInviteNum: 'SET_INVITE_NUM', - setReasourse: 'SET_RESOURSE', - setUserCon: 'SET_USERCON', - setUserSettings: 'SET_USERSETTINGS', - addNewUserCon: 'ADD_NEWUSERCON', - setAllResourse: 'SET_ALLURESOURSE', - setCurrentDlType: 'SET_CURRENT_DL_TYPE', - setCurrentPlantformType: 'SET_CURRENT_PLANTFORM_TYPE', - setAllBaseCon: 'SET_ALLBASECON', - }), - successCopied() { - let callConfig = { - msg: '复制成功!已将链接复制到剪贴板', - icon: 'fa-check-square-o', - time: '1500', - } - this.callMsgr(callConfig); - }, - }, + ...mapMutations({ + setGlobalConfig: 'SET_GLOBALCONFIG', + setHitokoto: 'SET_HITOKOTO', + setJinRiShiCi: 'SET_JINRISHICI', + setLoadState: 'SET_LOADSTATE', + setLoginToken: 'SET_LOGINTOKEN', + setUserMoney: 'SET_USERMONEY', + setInviteNum: 'SET_INVITE_NUM', + setReasourse: 'SET_RESOURSE', + setUserCon: 'SET_USERCON', + setUserSettings: 'SET_USERSETTINGS', + addNewUserCon: 'ADD_NEWUSERCON', + setAllResourse: 'SET_ALLURESOURSE', + setCurrentDlType: 'SET_CURRENT_DL_TYPE', + setCurrentPlantformType: 'SET_CURRENT_PLANTFORM_TYPE', + setAllBaseCon: 'SET_ALLBASECON', + setSignSet: 'SET_SIGNSET' + }), + successCopied () { + let callConfig = { + msg: '复制成功!已将链接复制到剪贴板', + icon: 'fa-check-square-o', + time: '1500' + } + this.callMsgr(callConfig) + } + } -} \ No newline at end of file +} diff --git a/uim-index-dev/src/mixins/userMixin.js b/uim-index-dev/src/mixins/userMixin.js index fc24f107..64316825 100644 --- a/uim-index-dev/src/mixins/userMixin.js +++ b/uim-index-dev/src/mixins/userMixin.js @@ -1,16 +1,16 @@ import { _get } from '../js/fetch' export default { - props: ['annC','baseURL'], - methods: { - reConfigResourse() { - _get('/getallresourse','include').then((r)=>{ - console.log(r); - this.updateUserSet(r.resourse); - }); - }, - updateUserSet(resourse) { - this.setAllResourse(resourse); - }, + props: ['annC', 'baseURL'], + methods: { + reConfigResourse () { + _get('/getallresourse', 'include').then((r) => { + console.log(r) + this.updateUserSet(r.resourse) + }) + }, + updateUserSet (resourse) { + this.setAllResourse(resourse) } -} \ No newline at end of file + } +} diff --git a/uim-index-dev/src/mixins/userSetMixin.js b/uim-index-dev/src/mixins/userSetMixin.js index 86ce78fd..d948d1a2 100644 --- a/uim-index-dev/src/mixins/userSetMixin.js +++ b/uim-index-dev/src/mixins/userSetMixin.js @@ -1,8 +1,8 @@ export default { - props: ['resourseTrans'], - methods: { - wheelChange(e) { - this.$emit('turnPageByWheel', e.deltaY); - }, - }, -} \ No newline at end of file + props: ['resourseTrans'], + methods: { + wheelChange (e) { + this.$emit('turnPageByWheel', e.deltaY) + } + } +} diff --git a/uim-index-dev/src/router.js b/uim-index-dev/src/router.js index 0f26a248..60343b05 100644 --- a/uim-index-dev/src/router.js +++ b/uim-index-dev/src/router.js @@ -14,109 +14,108 @@ import tmp from './store' Vue.use(Router) -let globalConfig; +let globalConfig const router = new Router({ routes: [{ - path: '/', - components: { - default: Root, - }, + path: '/', + components: { + default: Root + }, + meta: { + title: 'Index' + } + }, + { + path: '/auth/', + component: Auth, + redirect: '/auth/login', + meta: { + alreadyAuth: true + }, + children: [{ + path: 'Login', + component: Login, meta: { - title: 'Index', + title: 'login' } }, { - path: '/auth/', - component: Auth, - redirect: '/auth/login', + path: 'register', + component: Register, meta: { - alreadyAuth: true, - }, - children: [{ - path: 'Login', - component: Login, - meta: { - title: 'login', - } - }, - { - path: 'register', - component: Register, - meta: { - title: 'Register', - } - }, - ], + title: 'Register' + } + } + ] + }, + { + path: '/password/', + component: Password, + redirect: '/password/reset', + meta: { + alreadyAuth: true }, - { - path: '/password/', - component: Password, - redirect: '/password/reset', + children: [{ + path: 'reset', + component: Reset, meta: { - alreadyAuth: true - }, - children: [{ - path: 'reset', - component: Reset, - meta: { - title: 'Reset', - } - }, ], + title: 'Reset' + } + } ] + }, + { + path: '/user/', + component: User, + redirect: '/user/panel', + meta: { + requireAuth: true }, - { - path: '/user/', - component: User, - redirect: '/user/panel', + children: [{ + path: 'panel', + component: Panel, meta: { - requireAuth: true - }, - children: [{ - path: 'panel', - component: Panel, - meta: { - title: 'Usercenter', - } - }] - } - ], + title: 'Usercenter' + } + }] + } + ] }) router.beforeEach((to, from, next) => { if (!globalConfig) { _get('/globalconfig', 'include').then((r) => { if (r.ret == 1) { - globalConfig = r.globalConfig; + globalConfig = r.globalConfig if (globalConfig.geetest_html && globalConfig.geetest_html.success) { - globalConfig.isGetestSuccess = '1'; - tmp.commit('SET_GLOBALCONFIG', globalConfig); + globalConfig.isGetestSuccess = '1' + tmp.commit('SET_GLOBALCONFIG', globalConfig) } else { - globalConfig.isGetestSuccess = '0'; - tmp.commit('SET_GLOBALCONFIG', globalConfig); + globalConfig.isGetestSuccess = '0' + tmp.commit('SET_GLOBALCONFIG', globalConfig) } } }).then((r) => { - navGuardsForEach(); - }); + navGuardsForEach() + }) } else { - navGuardsForEach(); + navGuardsForEach() } - function navGuardsForEach() { + function navGuardsForEach () { if ((tmp.state.logintoken != false) && to.matched.some(function (record) { - return record.meta.alreadyAuth; - })) { - next('/user/panel'); + return record.meta.alreadyAuth + })) { + next('/user/panel') } else if ((tmp.state.logintoken == false) && to.matched.some(function (record) { - return record.meta.requireAuth; - })) { - next('/auth/login'); + return record.meta.requireAuth + })) { + next('/auth/login') } else { - document.title = tmp.state.globalConfig.indexMsg.appname + ' - ' + to.meta.title; - next(); + document.title = tmp.state.globalConfig.indexMsg.appname + ' - ' + to.meta.title + next() } } - }) -export default router; \ No newline at end of file +export default router diff --git a/uim-index-dev/src/store.js b/uim-index-dev/src/store.js index 5d97e714..baffbc8f 100644 --- a/uim-index-dev/src/store.js +++ b/uim-index-dev/src/store.js @@ -13,13 +13,13 @@ export default new Vuex.Store({ msg: '操作成功', html: '', icon: ['fa', 'fa-check-square-o'], - isShow: false, + isShow: false }, modalCon: { isMaskShow: false, isCardShow: false, title: '订单确认', - bodyContent: '', + bodyContent: '' }, globalConfig: { captchaProvider: '', @@ -40,97 +40,97 @@ export default new Vuex.Store({ appname: '', hitokoto: '', date: '', - jinrishici: '', - }, - }, + jinrishici: '' + } + } }, mutations: { - SET_LOADSTATE(state) { - state.isLoading = 'loaded'; + SET_LOADSTATE (state) { + state.isLoading = 'loaded' }, - SET_LOGINTOKEN(state, n) { - state.logintoken = n; + SET_LOGINTOKEN (state, n) { + state.logintoken = n }, - SET_MSGRCON(state, config) { + SET_MSGRCON (state, config) { if (state.msgrCon.html !== '') { - state.msgrCon.html = ''; + state.msgrCon.html = '' } - state.msgrCon.msg = config.msg; - state.msgrCon.icon[1] = config.icon; - state.msgrCon.html = config.html; + state.msgrCon.msg = config.msg + state.msgrCon.icon[1] = config.icon + state.msgrCon.html = config.html }, - ISSHOW_MSGR(state, boolean) { - state.msgrCon.isShow = boolean; + ISSHOW_MSGR (state, boolean) { + state.msgrCon.isShow = boolean }, - ISSHOW_MODAL_MASK(state, boolean) { - state.modalCon.isMaskShow = boolean; + ISSHOW_MODAL_MASK (state, boolean) { + state.modalCon.isMaskShow = boolean }, - ISSHOW_MODAL_CARD(state, boolean) { - state.modalCon.isCardShow = boolean; + ISSHOW_MODAL_CARD (state, boolean) { + state.modalCon.isCardShow = boolean }, - SET_GLOBALCONFIG(state, config) { + SET_GLOBALCONFIG (state, config) { state.logintoken = config.isLogin - state.globalConfig.base_url = config.base_url; - state.globalConfig.captchaProvider = config.captcha_provider; - state.globalConfig.recaptchaSiteKey = config.recaptcha_sitekey; - state.globalConfig.jumpDelay = config.jump_delay; - state.globalConfig.isGetestSuccess = config.isGetestSuccess; - state.globalConfig.registMode = config.register_mode; - state.globalConfig.isEmailVeryify = config.enable_email_verify; - state.globalConfig.enableLoginCaptcha = config.enable_logincaptcha; - state.globalConfig.enableRegCaptcha = config.enable_regcaptcha; - state.globalConfig.login_token = config.login_token; - state.globalConfig.login_number = config.login_number; - state.globalConfig.telegram_bot = config.telegram_bot; - state.globalConfig.crisp = config.enable_crisp; - state.globalConfig.enable_telegram = config.enable_telegram; - state.globalConfig.indexMsg.appname = config.appName; - state.globalConfig.indexMsg.date = config.dateY; + state.globalConfig.base_url = config.base_url + state.globalConfig.captchaProvider = config.captcha_provider + state.globalConfig.recaptchaSiteKey = config.recaptcha_sitekey + state.globalConfig.jumpDelay = config.jump_delay + state.globalConfig.isGetestSuccess = config.isGetestSuccess + state.globalConfig.registMode = config.register_mode + state.globalConfig.isEmailVeryify = config.enable_email_verify + state.globalConfig.enableLoginCaptcha = config.enable_logincaptcha + state.globalConfig.enableRegCaptcha = config.enable_regcaptcha + state.globalConfig.login_token = config.login_token + state.globalConfig.login_number = config.login_number + state.globalConfig.telegram_bot = config.telegram_bot + state.globalConfig.crisp = config.enable_crisp + state.globalConfig.enable_telegram = config.enable_telegram + state.globalConfig.indexMsg.appname = config.appName + state.globalConfig.indexMsg.date = config.dateY }, - SET_HITOKOTO(state, content) { - state.globalConfig.indexMsg.hitokoto = content; - }, - SET_JINRISHICI(state, content) { - state.globalConfig.indexMsg.jinrishici = content; + SET_HITOKOTO (state, content) { + state.globalConfig.indexMsg.hitokoto = content }, + SET_JINRISHICI (state, content) { + state.globalConfig.indexMsg.jinrishici = content + } }, actions: { - CALL_MSGR({ + CALL_MSGR ({ dispatch, commit, state }, config) { if (state.msgrCon.isShow === true) { - commit('ISSHOW_MSGR', false); + commit('ISSHOW_MSGR', false) setTimeout(() => { - dispatch('CALL_MSGR', config); - }, 300); + dispatch('CALL_MSGR', config) + }, 300) } else { - commit('SET_MSGRCON', config); - commit('ISSHOW_MSGR', true); + commit('SET_MSGRCON', config) + commit('ISSHOW_MSGR', true) window.setTimeout(function () { - commit('ISSHOW_MSGR', false); + commit('ISSHOW_MSGR', false) }, config.time) } }, - CALL_MODAL({ + CALL_MODAL ({ commit, state }, config) { if (state.modalCon.isMaskShow === false) { - commit('ISSHOW_MODAL_MASK', true); + commit('ISSHOW_MODAL_MASK', true) window.setTimeout(() => { commit('ISSHOW_MODAL_CARD', true) - }, 300); + }, 300) } else { - commit('ISSHOW_MODAL_CARD', false); + commit('ISSHOW_MODAL_CARD', false) window.setTimeout(() => { commit('ISSHOW_MODAL_MASK', false) - }, 300); + }, 300) } - }, + } }, modules: { - userState: UserTmp, + userState: UserTmp } -}) \ No newline at end of file +}) diff --git a/uim-index-dev/src/stores/UserStore.js b/uim-index-dev/src/stores/UserStore.js index f171a2ec..261582ea 100644 --- a/uim-index-dev/src/stores/UserStore.js +++ b/uim-index-dev/src/stores/UserStore.js @@ -1,113 +1,136 @@ import Vue from 'vue' export default { - state: { - userCon: '', - ssrSubToken: '', - subUrl: '', - iosAccount: '', - iosPassword: '', - displayIosClass: '', - userSettings: { - pages: [{ - id: 'user-resourse', - }, - { - id: 'user-settings', - }, - ], - currentPage: 'user-resourse', - currentPageIndex: 0, - resourse: [{ - name: '等级有效期', - content: '', - }, - { - name: '账号有效期', - content: '', - }, - { - name: '在线设备数', - content: '', - }, - { - name: '端口速率', - content: '', - }, - ], - tipsLink: [{ - name: '端口', - content: '', - }, - { - name: '密码', - content: '', - }, - { - name: '加密', - content: '', - }, - { - name: '协议', - content: '', - }, - { - name: '混淆', - content: '', - }, - { - name: '混淆参数', - content: '', - }, - ], - }, - currentDlType: 'SSR', - currentPlantformType: 'WINDOWS', + state: { + userCon: '', + ssrSubToken: '', + subUrl: '', + iosAccount: '', + iosPassword: '', + displayIosClass: '', + sign: { + isTrsfficRefreshed: false, + isSignShow: false, + transition: false }, - mutations: { - SET_USERCON(state, config) { - state.userCon = config; - }, - SET_USERMONEY(state, number) { - state.userCon.money = number; + userSettings: { + pages: [{ + id: 'user-resourse' }, - SET_INVITE_NUM(state, number) { - state.userCon.invite_num = number; + { + id: 'user-settings' + } + ], + currentPage: 'user-resourse', + currentPageIndex: 0, + resourse: [{ + name: '等级有效期', + content: '' }, - SET_USERSETTINGS(state, config) { - state.userSettings.tipsLink[0].content = config.port; - state.userSettings.tipsLink[1].content = config.passwd; - state.userSettings.tipsLink[2].content = config.method; - state.userSettings.tipsLink[3].content = config.protocol; - state.userSettings.tipsLink[4].content = config.obfs; - state.userSettings.tipsLink[5].content = config.obfs_param; + { + name: '账号有效期', + content: '' }, - ADD_NEWUSERCON(state, config) { - for (let key in config) { - Vue.set(state.userCon, key, config[key]); - } + { + name: '在线设备数', + content: '' }, - SET_RESOURSE(state, config) { - state.userSettings.resourse[config.index].content = config.content; + { + name: '端口速率', + content: '' + } + ], + tipsLink: [{ + name: '端口', + content: '' }, - SET_ALLURESOURSE(state, config) { - for (let key in config) { - state.userCon[key] = config[key]; - } + { + name: '密码', + content: '' }, - SET_CURRENT_DL_TYPE (state, content) { - state.currentDlType = content; + { + name: '加密', + content: '' }, - SET_CURRENT_PLANTFORM_TYPE (state, content) { - state.currentPlantformType = content; + { + name: '协议', + content: '' }, - SET_ALLBASECON (state, config) { - for (let key in config) { - Vue.set(state, key, config[key]); - } + { + name: '混淆', + content: '' }, + { + name: '混淆参数', + content: '' + } + ] }, - actions: { - + currentDlType: 'SSR', + currentPlantformType: 'WINDOWS' + }, + mutations: { + SET_USERCON(state, config) { + state.userCon = config + }, + SET_USERMONEY(state, number) { + state.userCon.money = number + }, + SET_INVITE_NUM(state, number) { + state.userCon.invite_num = number + }, + SET_USERSETTINGS(state, config) { + state.userSettings.tipsLink[0].content = config.port + state.userSettings.tipsLink[1].content = config.passwd + state.userSettings.tipsLink[2].content = config.method + state.userSettings.tipsLink[3].content = config.protocol + state.userSettings.tipsLink[4].content = config.obfs + state.userSettings.tipsLink[5].content = config.obfs_param + }, + ADD_NEWUSERCON(state, config) { + for (let key in config) { + Vue.set(state.userCon, key, config[key]) + } + }, + SET_RESOURSE(state, config) { + state.userSettings.resourse[config.index].content = config.content + }, + SET_ALLURESOURSE(state, config) { + for (let key in config) { + state.userCon[key] = config[key] + } + }, + SET_CURRENT_DL_TYPE(state, content) { + state.currentDlType = content + }, + SET_CURRENT_PLANTFORM_TYPE(state, content) { + state.currentPlantformType = content + }, + SET_ALLBASECON(state, config) { + for (let key in config) { + Vue.set(state, key, config[key]) + } }, -} \ No newline at end of file + SET_SIGNSET(state, config) { + for (let key in config) { + state.sign[key] = config[key]; + } + } + }, + actions: { + TraffictransTrigger({ + dispatch, + commit, + state + }, config) { + commit('SET_SIGNSET', { + isTrsfficRefreshed: true + }); + window.setTimeout(() => { + commit('SET_SIGNSET', { + isTrsfficRefreshed: false + }); + }, 300) + } + } +} diff --git a/uim-index-dev/src/views/Auth.vue b/uim-index-dev/src/views/Auth.vue index 38c023cc..744a9b79 100644 --- a/uim-index-dev/src/views/Auth.vue +++ b/uim-index-dev/src/views/Auth.vue @@ -2,7 +2,7 @@