huangbin 4 năm trước cách đây
mục cha
commit
413df23ea4
2 tập tin đã thay đổi với 23 bổ sung4 xóa
  1. 12 1
      src/services/request/serviceURL.ts
  2. 11 3
      src/views/account/login.vue

+ 12 - 1
src/services/request/serviceURL.ts

@@ -8,6 +8,8 @@
  * serviceURL.commSearchUrl
  */
 
+import { ref } from "vue";
+
 interface URL {
     commSearchUrl: string;
     goCommonSearchUrl: string;
@@ -78,14 +80,23 @@ export const getUplodaUrl = (): string => {
     return serviceURL.uploadUrl
 }
 
+// 是否有开户地址
+export const isOpenUrl = ref<boolean>(false)
+
 export const setServiceURL = (config: URL): void => {
     // console.log('URL', config);
     //外网环境(175),外包同事使用
     serviceURL = config;
+    if (config.openApiUrl) {
+        isOpenUrl.value = true
+    } else {
+        isOpenUrl.value = false
+    }
     // if (process.env.NODE_ENV === 'development') {
     //     serviceURL.goCommonSearchUrl = 'http://218.17.158.45:21001/api';
     //     serviceURL.quoteUrl = 'ws://218.17.158.45:21009';
     //     serviceURL.tradeUrl = 'ws://218.17.158.45:21010';
     // }
     console.log('api地址:', serviceURL);
-};
+};
+

+ 11 - 3
src/views/account/login.vue

@@ -55,6 +55,8 @@
               <a-button @click="loginAction"
                         :loading="loading"
                         :disabled="goHomeloading">登录</a-button>
+              <div class="register"
+                   v-if="isOpenUrl">还没有账号,<span @click="register">立即注册</span></div>
             </a-form-item>
           </a-form>
         </div>
@@ -64,7 +66,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, reactive, ref, toRaw, onMounted } from 'vue';
+import { defineComponent, reactive, ref, toRaw, onMounted, watchEffect, watch } from 'vue';
 import { globalDataRefresh } from '@/services/bus/index';
 import { login } from '@/services/bus/login';
 import { useRouter } from 'vue-router';
@@ -74,7 +76,7 @@ import { initData, setLoadComplete } from '@/common/methods';
 import eventBus from '@/utils/eventBus/index';
 import { QWebChannel } from '@/utils/qt/qwebchannel.js';
 import { qtAction } from './qt';
-import { serviceURL } from '@/services/request/serviceURL';
+import { serviceURL, isOpenUrl } from '@/services/request/serviceURL';
 
 interface Form {
     account: string;
@@ -216,12 +218,18 @@ export default defineComponent({
                     goHomeloading.value = false;
                 });
         };
-        return { form, loginAction, rules, formDom, loading, goHomeloading, goHome };
+        function register() {
+            window.open(serviceURL.openApiUrl, '_blank');
+        }
+        return { form, loginAction, rules, formDom, loading, goHomeloading, goHome, register, isOpenUrl };
     },
 });
 </script>
 
 <style lang="less" scoped>
+.register {
+    cursor: pointer;
+}
 .login {
     width: 100%;
     height: 100%;