uView升级http配置兼容变更
人生须知负责任的苦处,才能知道尽责任的乐趣。——梁启超 今天把老项目uniapp的http封装代码cv过来,发现用不了了,原因是uView版本升级了没适配 原先uView 1.x的方式: 123456789101112131415161718192021222324Vue.prototype.$u.http.setConfig({ baseUrl: 'http://localhost:8080/ruben', loadingText: '加载中...', loadingTime: 100,});Vue.prototype.$u.http.interceptor.request = (config) => { const token = uni.getStorageSync('token'); config.header.token = token; return config;}Vue.prototype.$u.http.interce...
HBuilderX运行到iOS真机
人生的光荣,不在永不失败,而在于能够屡扑屡起。——拿破仑 直接选择运行——运行到手机或模拟器——运行到iOS APP基座 这里使用标准基座运行需要使用Apple证书签名 点开有四个配置项 Bundle ID(AppID)——是自己设置的 这个可以是包名,我们到Identifiers里新建一个,Bundle ID(AppID)填写我们的包名即可 https://developer.apple.com/account/resources/identifiers/list 证书私钥密码——是自己设置的 我们在mac上打开钥匙串访问,左上角菜单栏点击钥匙串访问 选择证书助理——使用"chao a"从证书颁发机构请求证书 然后填写自己设置的密码 此处还生成一个文件CertificateSigningRequest.certSigningRequest 证书profile文件: 在Profiles新建后下载得到robotrobot.mobileprovision,我们在HBuilderX选这个文件即可 https://developer.apple.com/accou...
typescript-exercises(十五)
人的一辈子都在高潮—低潮中浮沉,唯有庸碌的人,生活才如死水一般。——傅雷 问题: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051/*Intro: Our attempt to Open Source didn't work quite as expected. It turned out there were already many existing functional JS libraries. All the remaining developers left the company as well. It seems that they are joining a very ambitious startup which re-invented a juicer and raised millions of dollars. Too bad we cannot compe...
typescript-exercises(十四)
人心就是立国的大根本。——孙中山 问题: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194...
typescript-exercises(十三)
人不仅为自己而生,而且也为祖国活着。——柏拉图 题目: 123456// This enables module augmentation mode.import 'date-wizard';declare module 'date-wizard' { // Add your module extensions here.} 报错: 12345index.ts(79,30): error TS2339: Property 'pad' does not exist on type 'typeof import("/node_modules/date-wizard/index.d.ts")'.index.ts(101,67): error TS2339: Property 'hours' does not exist on type 'DateDetails'.test.ts(5,5): error TS2344:...
typescript-exercises(十二)
人民是土壤,它含有要切事物发展所必需的生命汁液;而个人则是这土壤上的花朵与果实。——别林斯基 题目: 123declare module 'stats' { export function getMaxIndex(input: unknown, comparator: unknown): unknown;} 报错: 123456789101112131415index.ts(3,5): error TS2305: Module '"stats"' has no exported member 'getMaxElement'.index.ts(4,5): error TS2724: Module '"stats"' has no exported member 'getMinIndex'. Did you mean 'getMaxIndex'?index.ts(5,5): error TS23...
typescript-exercises(十一)
人只有在人们中间才能认识自己。——歌德 题目: 1234declare module 'str-utils' { // export const ... // export function ...} 报错: 123456index.ts(2,5): error TS2305: Module '"str-utils"' has no exported member 'strReverse'.index.ts(3,5): error TS2305: Module '"str-utils"' has no exported member 'strToLower'.index.ts(4,5): error TS2305: Module '"str-utils"' has no exported member 'strToUpper'.index.ts(...
typescript-exercises(十)
如果你不尊敬你的父母,那你的孩子也将不会尊敬你。——佚名 题目: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146/*Intro: We have asynchronous functions now, advanced technology. This makes us a tech startup officially now. But one of t...
typescript-exercises(九)
如果你要宽容别人的过错,就要把眼光放到自己身上。——佚名 题目: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170/*Intro: PowerUsers idea was bad. Once those users got ...
typescript-exercises(八)
再也无需前思后想,一切岂非已然过往。——《且听风吟》 题目: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293/*Intro: Project grew and we ended up in a situation with some users starting to have more influence. Therefore, we decided to create a new person type called PowerUser which is supposed to combine everything User and Admin have.Exercise: Define type PowerUser which sh...
