gc_mobile 1.0.12 → 1.1.0

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.
@@ -1,57 +1,63 @@
1
- <script>
2
- import mobile,{utils} from "../../libs/main";
1
+ <script>
2
+ import mobile, { utils } from "../../libs/main";
3
3
  import signature from "gc_rsa/src/lib/signature";
4
4
 
5
5
  import Request from "luch-request";
6
6
  const http = new Request();
7
- http.interceptors.request.use(config=>{
8
- console.log("config",config)
9
- if(config.url.indexOf("/apiList") > -1){
10
-
11
- // originQuery: config.params,
12
- // });
13
- }
14
- return config
15
- })
16
- export default {
7
+ http.interceptors.request.use((config) => {
8
+ console.log("config", config);
9
+ if (config.url.indexOf("/apiList") > -1) {
10
+ // originQuery: config.params,
11
+ // });
12
+ }
13
+ return config;
14
+ });
15
+ export default {
17
16
  onLaunch: async function () {
18
- console.log("set", utils.setNavigationBarTitle({ title: "新标题" }));
19
- const gg = await mobile({
20
- appCode: "GC-MOBILE",
21
- apiPrefix: "prod",
22
- gc_rsa:{
23
- appkey:"36994808",
24
- appsecret:"C075B40D14FE11EBB839BD250AF9C3C0",
25
- // exclude(request){
26
- // console.log("request",request)
27
- // return request.url.indexOf("/apiList") == -1
28
- // }
29
- }
17
+ console.log("set", utils.setNavigationBarTitle({ title: "新标题" }));
18
+ const gg = await mobile({
19
+ appCode: "GC-MOBILE",
20
+ apiPrefix: "dev",
21
+ manual:true,
22
+ gc_rsa: {
23
+ appkey: "36994808",
24
+ appsecret: "C075B40D14FE11EBB839BD250AF9C3C0"
25
+ // exclude(request){
26
+ // console.log("request",request)
27
+ // return request.url.indexOf("/apiList") == -1
28
+ // }
29
+ }
30
30
  });
31
- console.log("gg",gg)
32
- http.get('http://192.168.0.38:3000/mock/106/api/table').then(res => {
33
- console.log("返回数据",res)
34
- }).catch(err => {
35
- console.log("错误数据",err)
36
- })
37
- http.get('http://192.168.0.38:3000/mock/106/api/test').then(res => {
38
- console.log("返回数据",res)
39
- }).catch(err => {
40
- console.log("错误数据",err)
41
- })
42
- console.log("gg", gg.userInfo);
43
- this.$store.commit("setUserInfo", gg.userInfo);
44
- console.log("App Launch");
45
- },
46
- onShow: function () {
47
- console.log("App Show");
48
- },
49
- onHide: function () {
50
- console.log("App Hide");
51
- }
52
- };
53
- </script>
54
-
55
- <style>
56
- /*每个页面公共css */
57
- </style>
31
+ console.log("gg", gg);
32
+ http
33
+ .get("http://192.168.0.38:3000/mock/106/api/table")
34
+ .then((res) => {
35
+ console.log("返回数据", res);
36
+ })
37
+ .catch((err) => {
38
+ console.log("错误数据", err);
39
+ });
40
+ http
41
+ .get("http://192.168.0.38:3000/mock/106/api/test")
42
+ .then((res) => {
43
+ console.log("返回数据", res);
44
+ })
45
+ .catch((err) => {
46
+ console.log("错误数据", err);
47
+ });
48
+ console.log("gg", gg.userInfo);
49
+ this.$store.commit("setUserInfo", gg.userInfo);
50
+ console.log("App Launch");
51
+ },
52
+ onShow: function () {
53
+ console.log("App Show");
54
+ },
55
+ onHide: function () {
56
+ console.log("App Hide");
57
+ }
58
+ };
59
+ </script>
60
+
61
+ <style>
62
+ /*每个页面公共css */
63
+ </style>
@@ -1,57 +1,78 @@
1
1
  <template>
2
- <view class="content">
3
- <view class="token">userInfo:{{ userInfo }}</View>
4
- <view class="token">token:{{ userInfo && userInfo.ucToken }}</View>
5
- </view>
2
+ <view class="content">
3
+ <view class="token">userInfo:{{ userInfo }}</view>
4
+ <view class="token">token:{{ userInfo && userInfo.ucToken }}</view>
5
+ <view
6
+ class="token"
7
+ @click="bind"
8
+ >绑定</view
9
+ >
10
+ <view
11
+ class="token"
12
+ @click="unBind"
13
+ >解绑</view
14
+ >
15
+ </view>
6
16
  </template>
7
17
 
8
18
  <script>
9
- export default {
10
- data() {
11
- return {
12
- title: "Hello"
13
- };
14
- },
15
- computed: {
16
- userInfo() {
17
- return this.$store.state.userInfo
18
- }
19
- },
20
- onLoad() {},
21
- methods: {}
22
- };
19
+ export default {
20
+ data() {
21
+ return {
22
+ title: "Hello"
23
+ };
24
+ },
25
+ computed: {
26
+ userInfo() {
27
+ return this.$store.state.userInfo;
28
+ }
29
+ },
30
+ onLoad() {},
31
+ methods: {
32
+ async unBind() {
33
+ const res = await this.userInfo.unBind();
34
+ console.log("res",res)
35
+ if(res){
36
+ location.reload()
37
+ }
38
+ },
39
+ async bind() {
40
+ this.userInfo.bind();
41
+ }
42
+ }
43
+ };
23
44
  </script>
24
45
 
25
46
  <style>
26
- .content {
27
- display: flex;
28
- flex-direction: column;
29
- align-items: center;
30
- justify-content: center;
31
- }
47
+ .content {
48
+ display: flex;
49
+ flex-direction: column;
50
+ align-items: center;
51
+ justify-content: center;
52
+ }
32
53
 
33
- .logo {
34
- height: 200rpx;
35
- width: 200rpx;
36
- margin-top: 200rpx;
37
- margin-left: auto;
38
- margin-right: auto;
39
- margin-bottom: 50rpx;
40
- }
54
+ .logo {
55
+ height: 200rpx;
56
+ width: 200rpx;
57
+ margin-top: 200rpx;
58
+ margin-left: auto;
59
+ margin-right: auto;
60
+ margin-bottom: 50rpx;
61
+ }
41
62
 
42
- .text-area {
43
- display: flex;
44
- justify-content: center;
45
- }
63
+ .text-area {
64
+ display: flex;
65
+ justify-content: center;
66
+ }
46
67
 
47
- .title {
48
- font-size: 36rpx;
49
- color: #8f8f94;
50
- }
68
+ .title {
69
+ font-size: 36rpx;
70
+ color: #8f8f94;
71
+ }
51
72
 
52
- .token {
53
- width: 80%;
54
- margin-left:10%;
55
- margin-top:20px
56
- }
57
- </style>
73
+ .token {
74
+ width: 80%;
75
+ margin-left: 10%;
76
+ margin-top: 20px;
77
+ }
78
+ </style>