@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
const apis_http = require("./http.js");
|
||||
function getWxId(params) {
|
||||
return apis_http.http({
|
||||
method: "POST",
|
||||
url: "/QingLong/HuiYa/wxLogin",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
exports.getWxId = getWxId;
|
@ -1,48 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../common/vendor.js");
|
||||
const baseUrl = "https://www.hzkjai.com";
|
||||
const httpInterceptor = {
|
||||
invoke(options) {
|
||||
if (!options.url.startsWith("http")) {
|
||||
options.url = (options.baseUrl ? options.baseUrl : baseUrl) + options.url;
|
||||
}
|
||||
options.timeout = 1e4;
|
||||
options.header = {
|
||||
...options.header,
|
||||
"source-client": "miniapp",
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
};
|
||||
}
|
||||
};
|
||||
common_vendor.index.addInterceptor("request", httpInterceptor);
|
||||
const http = (options) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.request({
|
||||
...options,
|
||||
//请求成功
|
||||
success(res) {
|
||||
console.log("success:", res);
|
||||
if (res.statusCode >= 200 && res.statusCode < 300) {
|
||||
resolve(res.data);
|
||||
} else if (res.statusCode === 401) {
|
||||
reject(res);
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: res.data.msg || "请求错误"
|
||||
});
|
||||
reject(res);
|
||||
}
|
||||
},
|
||||
//响应失败
|
||||
fail(err) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "网络错误,请更换网络试试~"
|
||||
});
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
exports.http = http;
|
@ -1,28 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const common_vendor = require("./common/vendor.js");
|
||||
const utils_commonUtil = require("./utils/commonUtil.js");
|
||||
if (!Math) {
|
||||
"./pages/home/home.js";
|
||||
"./pages/works/works.js";
|
||||
"./pages/my/my.js";
|
||||
}
|
||||
const _sfc_main = {
|
||||
onLaunch: function() {
|
||||
utils_commonUtil.wxLogin();
|
||||
},
|
||||
onShow: function() {
|
||||
console.log("App Show");
|
||||
},
|
||||
onHide: function() {
|
||||
console.log("App Hide");
|
||||
}
|
||||
};
|
||||
function createApp() {
|
||||
const app = common_vendor.createSSRApp(_sfc_main);
|
||||
return {
|
||||
app
|
||||
};
|
||||
}
|
||||
createApp().app.mount("#app");
|
||||
exports.createApp = createApp;
|
@ -1,30 +0,0 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/home/home",
|
||||
"pages/works/works",
|
||||
"pages/my/my"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationBarBackgroundColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"list": [
|
||||
{
|
||||
"text": "首页",
|
||||
"pagePath": "pages/home/home"
|
||||
},
|
||||
{
|
||||
"text": "作品",
|
||||
"pagePath": "pages/works/works"
|
||||
},
|
||||
{
|
||||
"text": "我的",
|
||||
"pagePath": "pages/my/my"
|
||||
}
|
||||
]
|
||||
},
|
||||
"usingComponents": {}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
onLoad() {
|
||||
console.log("主页");
|
||||
},
|
||||
methods: {
|
||||
getDataList() {
|
||||
const token = common_vendor.index.getStorageSync("token");
|
||||
console.log("token:", token);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.o(($event) => $options.getDataList())
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "绘智AI相机",
|
||||
"usingComponents": {}
|
||||
}
|
@ -1 +0,0 @@
|
||||
主页 <button bindtap="{{a}}">获取数据</button>
|
@ -1,8 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {};
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return {};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的",
|
||||
"usingComponents": {}
|
||||
}
|
@ -1 +0,0 @@
|
||||
我的
|
@ -1,8 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {};
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return {};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "作品",
|
||||
"usingComponents": {}
|
||||
}
|
@ -1 +0,0 @@
|
||||
作品
|
@ -1,29 +0,0 @@
|
||||
{
|
||||
"description": "项目配置文件。",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"postcss": false,
|
||||
"minified": false,
|
||||
"newFeature": true,
|
||||
"bigPackageSizeSupport": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
}
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.5.3",
|
||||
"appid": "wx6ab0b6b54c3361c0",
|
||||
"projectname": "ai-camera",
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 2
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 470 B |
Before Width: | Height: | Size: 511 B |
Before Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 472 B |
Before Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 365 B |
Before Width: | Height: | Size: 587 B |
Before Width: | Height: | Size: 565 B |
@ -1,20 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "customicons"; /* Project id 2878519 */
|
||||
src:url('/static/customicons.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.customicons {
|
||||
font-family: "customicons" !important;
|
||||
}
|
||||
|
||||
.youxi:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
|
||||
.wenjian:before {
|
||||
content: "\e60f";
|
||||
}
|
||||
|
||||
.zhuanfa:before {
|
||||
content: "\e610";
|
||||
}
|
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.1 KiB |
@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../common/vendor.js");
|
||||
const apis_api = require("../apis/api.js");
|
||||
function wxLogin() {
|
||||
common_vendor.index.login({
|
||||
success(res) {
|
||||
if (res.code) {
|
||||
apis_api.getWxId({
|
||||
code: res.code
|
||||
}).then((wxInfo) => {
|
||||
if (wxInfo.success) {
|
||||
common_vendor.index.setStorageSync("token", wxInfo.token);
|
||||
common_vendor.index.setStorageSync("id", wxInfo.id);
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
icon: "fail",
|
||||
title: "用户信息获取失败!"
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
icon: "fail",
|
||||
title: "登录失败!"
|
||||
});
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
common_vendor.index.showToast({
|
||||
icon: "fail",
|
||||
title: "登录失败!"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.wxLogin = wxLogin;
|